danger.crypto
Interface PublicKey

All Known Implementing Classes:
DSAKey, RSAKey


public interface PublicKey

Interface for public key implementations, such as RSAKey or DSAKey. Such a key may be used to verify signatures.

Since:
4.0

Method Summary
 boolean verify(byte[] data, int dataOffset, int dataLength, byte[] sig)
          Verify a signature.
 boolean verify(byte[] data, int dataOffset, int dataLength, byte[] sig, int sigOffset, int sigLength)
          Verify a signature.
 

Method Detail

verify

boolean verify(byte[] data,
               int dataOffset,
               int dataLength,
               byte[] sig,
               int sigOffset,
               int sigLength)
               throws PublicKeyException
Verify a signature.

Parameters:
data - the data to be verified
dataOffset - offset into the data to begin verifying
dataLength - number of bytes to verify
sig - buffer containing the signature to be verified
sigOffset - offset of the signature in the buffer
sigLength - number of bytes in the signature
Returns:
true if the signature is valid
Throws:
PublicKeyException - if this isn't a proper public key, or the signature is malformed

verify

boolean verify(byte[] data,
               int dataOffset,
               int dataLength,
               byte[] sig)
               throws PublicKeyException
Verify a signature.

Parameters:
data - the data to be verified
dataOffset - offset into the data to begin verifying
dataLength - number of bytes to verify
sig - the signature to be verified
Returns:
true if the signature is valid
Throws:
PublicKeyException - if this isn't a proper public key, or the signature is malformed