MCPcopy Create free account
hub / github.com/DeNA/PacketProxy / toECDSAPublicKey

Method toECDSAPublicKey

src/main/java/core/org/xbill/DNS/DNSSEC.java:509–522  ·  view source on GitHub ↗
(KEYBase r, ECKeyInfo keyinfo)

Source from the content-addressed store, hash-verified

507}
508
509private static PublicKey
510toECDSAPublicKey(KEYBase r, ECKeyInfo keyinfo) throws IOException,
511 GeneralSecurityException, MalformedKeyException
512{
513 DNSInput in = new DNSInput(r.getKey());
514
515 // RFC 6605 Section 4
516 BigInteger x = readBigInteger(in, keyinfo.length);
517 BigInteger y = readBigInteger(in, keyinfo.length);
518 ECPoint q = new ECPoint(x, y);
519
520 KeyFactory factory = KeyFactory.getInstance("EC");
521 return factory.generatePublic(new ECPublicKeySpec(q, keyinfo.spec));
522}
523
524/** Converts a KEY/DNSKEY record into a PublicKey */
525static PublicKey

Callers 1

toPublicKeyMethod · 0.95

Calls 3

readBigIntegerMethod · 0.95
getKeyMethod · 0.45
getInstanceMethod · 0.45

Tested by

no test coverage detected