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

Method signMessage

src/main/java/core/org/xbill/DNS/DNSSEC.java:1074–1095  ·  view source on GitHub ↗
(Message message, SIGRecord previous, KEYRecord key,
	    PrivateKey privkey, Date inception, Date expiration)

Source from the content-addressed store, hash-verified

1072}
1073
1074static SIGRecord
1075signMessage(Message message, SIGRecord previous, KEYRecord key,
1076 PrivateKey privkey, Date inception, Date expiration)
1077 throws DNSSECException
1078{
1079 int alg = key.getAlgorithm();
1080 checkAlgorithm(privkey, alg);
1081
1082 SIGRecord sig = new SIGRecord(Name.root, DClass.ANY, 0, 0,
1083 alg, 0, expiration, inception,
1084 key.getFootprint(),
1085 key.getName(), null);
1086 DNSOutput out = new DNSOutput();
1087 digestSIG(out, sig);
1088 if (previous != null)
1089 out.writeByteArray(previous.getSignature());
1090 out.writeByteArray(message.toWire());
1091
1092 sig.setSignature(sign(privkey, key.getPublicKey(),
1093 alg, out.toByteArray(), null));
1094 return sig;
1095}
1096
1097static void
1098verifyMessage(Message message, byte [] bytes, SIGRecord sig, SIGRecord previous,

Callers 1

signMessageMethod · 0.95

Calls 12

checkAlgorithmMethod · 0.95
digestSIGMethod · 0.95
writeByteArrayMethod · 0.95
signMethod · 0.95
toByteArrayMethod · 0.95
setSignatureMethod · 0.80
getPublicKeyMethod · 0.80
getNameMethod · 0.65
getAlgorithmMethod · 0.45
getFootprintMethod · 0.45
getSignatureMethod · 0.45
toWireMethod · 0.45

Tested by

no test coverage detected