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

Method checkAlgorithm

src/main/java/core/org/xbill/DNS/DNSSEC.java:992–1018  ·  view source on GitHub ↗
(PrivateKey key, int alg)

Source from the content-addressed store, hash-verified

990 return signature;
991}
992static void
993checkAlgorithm(PrivateKey key, int alg) throws UnsupportedAlgorithmException
994{
995 switch (alg) {
996 case Algorithm.RSAMD5:
997 case Algorithm.RSASHA1:
998 case Algorithm.RSA_NSEC3_SHA1:
999 case Algorithm.RSASHA256:
1000 case Algorithm.RSASHA512:
1001 if (! (key instanceof RSAPrivateKey))
1002 throw new IncompatibleKeyException();
1003 break;
1004 case Algorithm.DSA:
1005 case Algorithm.DSA_NSEC3_SHA1:
1006 if (! (key instanceof DSAPrivateKey))
1007 throw new IncompatibleKeyException();
1008 break;
1009 case Algorithm.ECC_GOST:
1010 case Algorithm.ECDSAP256SHA256:
1011 case Algorithm.ECDSAP384SHA384:
1012 if (! (key instanceof ECPrivateKey))
1013 throw new IncompatibleKeyException();
1014 break;
1015 default:
1016 throw new UnsupportedAlgorithmException(alg);
1017 }
1018}
1019
1020/**
1021 * Generate a DNSSEC signature. key and privateKey must refer to the

Callers 2

signMethod · 0.95
signMessageMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected