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

Method toRSAPublicKey

src/main/java/core/org/xbill/DNS/DNSSEC.java:415–426  ·  view source on GitHub ↗
(KEYBase r)

Source from the content-addressed store, hash-verified

413}
414
415private static PublicKey
416toRSAPublicKey(KEYBase r) throws IOException, GeneralSecurityException {
417 DNSInput in = new DNSInput(r.getKey());
418 int exponentLength = in.readU8();
419 if (exponentLength == 0)
420 exponentLength = in.readU16();
421 BigInteger exponent = readBigInteger(in, exponentLength);
422 BigInteger modulus = readBigInteger(in);
423
424 KeyFactory factory = KeyFactory.getInstance("RSA");
425 return factory.generatePublic(new RSAPublicKeySpec(modulus, exponent));
426}
427
428private static PublicKey
429toDSAPublicKey(KEYBase r) throws IOException, GeneralSecurityException,

Callers 1

toPublicKeyMethod · 0.95

Calls 5

readU8Method · 0.95
readU16Method · 0.95
readBigIntegerMethod · 0.95
getKeyMethod · 0.45
getInstanceMethod · 0.45

Tested by

no test coverage detected