org.xbill.DNS.security
Class SIG0Signer

java.lang.Object
  extended by org.xbill.DNS.security.SIG0Signer

public class SIG0Signer
extends Object

Creates SIG(0) transaction signatures.

Author:
Pasi Eronen, Brian Wellington

Constructor Summary
SIG0Signer(int algorithm, PrivateKey privateKey, Name name, int keyFootprint)
          Creates a new SIG(0) signer object.
SIG0Signer(int algorithm, PrivateKey privateKey, Name name, PublicKey publicKey)
          Creates a new SIG(0) signer object.
 
Method Summary
 void apply(Message m, byte[] old)
          Appends a SIG(0) signature to the message.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SIG0Signer

public SIG0Signer(int algorithm,
                  PrivateKey privateKey,
                  Name name,
                  int keyFootprint)
Creates a new SIG(0) signer object.

Parameters:
algorithm - usually DNSSEC.RSAMD5, DNSSEC.DSA, or DNSSEC.RSASHA1
privateKey - signing key (must match algorithm)
name - the name of the key
keyFootprint - the key tag

SIG0Signer

public SIG0Signer(int algorithm,
                  PrivateKey privateKey,
                  Name name,
                  PublicKey publicKey)
Creates a new SIG(0) signer object. This is the same as the other constructor, except that the key tag is calculated automatically from the given public key.

Method Detail

apply

public void apply(Message m,
                  byte[] old)
           throws IOException,
                  SignatureException,
                  InvalidKeyException,
                  NoSuchAlgorithmException
Appends a SIG(0) signature to the message.

Parameters:
m - the message
old - if this message is a response, the original message
Throws:
IOException
SignatureException
InvalidKeyException
NoSuchAlgorithmException