(Message message, SIGRecord previous, KEYRecord key, PrivateKey privkey, Date inception, Date expiration)
| 1072 | } |
| 1073 | |
| 1074 | static SIGRecord |
| 1075 | signMessage(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 | |
| 1097 | static void |
| 1098 | verifyMessage(Message message, byte [] bytes, SIGRecord sig, SIGRecord previous, |
no test coverage detected