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

Method toDSAPublicKey

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

Source from the content-addressed store, hash-verified

426}
427
428private static PublicKey
429toDSAPublicKey(KEYBase r) throws IOException, GeneralSecurityException,
430 MalformedKeyException
431{
432 DNSInput in = new DNSInput(r.getKey());
433
434 int t = in.readU8();
435 if (t > 8)
436 throw new MalformedKeyException(r);
437
438 BigInteger q = readBigInteger(in, 20);
439 BigInteger p = readBigInteger(in, 64 + t*8);
440 BigInteger g = readBigInteger(in, 64 + t*8);
441 BigInteger y = readBigInteger(in, 64 + t*8);
442
443 KeyFactory factory = KeyFactory.getInstance("DSA");
444 return factory.generatePublic(new DSAPublicKeySpec(y, p, q, g));
445}
446
447private static class ECKeyInfo {
448 int length;

Callers 1

toPublicKeyMethod · 0.95

Calls 4

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

Tested by

no test coverage detected