anon.crypto
Interface ISignatureVerificationAlgorithm

All Known Subinterfaces:
IMySignature
All Known Implementing Classes:
MyDSASignature, MyECDSASignature, MyRSASignature

public interface ISignatureVerificationAlgorithm

This interface represents an algorithm that verifies cryptographic signatures.


Method Summary
 byte[] decodeForXMLSignature(byte[] a_encodedSignature)
          Tries to decode a signature in a way as it would meet the W3C standard for XML signature values.
 org.bouncycastle.asn1.x509.AlgorithmIdentifier getIdentifier()
           
 java.lang.String getXMLSignatureAlgorithmReference()
          Returns a description of the the signature algorithm for XML signatures as defined in http://www.w3.org/TR/xmldsig-core/#sec-AlgID.
 boolean verify(byte[] a_message, byte[] a_signature)
          Tests if the signature of a specified message is valid.
 boolean verify(byte[] a_message, int message_offset, int message_len, byte[] a_signature, int signature_offset, int signature_len)
          Tests if the signature of a specified message is valid.
 

Method Detail

verify

boolean verify(byte[] a_message,
               byte[] a_signature)
Tests if the signature of a specified message is valid.

Parameters:
a_message - a message
a_signature - a signature
Returns:
true if the signature of a specified message is valid; false otherwiese

verify

boolean verify(byte[] a_message,
               int message_offset,
               int message_len,
               byte[] a_signature,
               int signature_offset,
               int signature_len)
Tests if the signature of a specified message is valid.

Parameters:
a_message - a message
message_offset - start of message
message_len - length of message
a_signature - a signature
signature_offset - start of signature
signature_len - length of signature
Returns:
true if the signature of a specified message is valid; false otherwiese

decodeForXMLSignature

byte[] decodeForXMLSignature(byte[] a_encodedSignature)
Tries to decode a signature in a way as it would meet the W3C standard for XML signature values. Without this decoding, RSA XML signatures cannot be verified.

Parameters:
a_encodedSignature - an encoded signature
Returns:
the decoded signature or null if an error occured
See Also:
http://www.w3.org/TR/xmldsig-core/#sec-SignatureAlg

getXMLSignatureAlgorithmReference

java.lang.String getXMLSignatureAlgorithmReference()
Returns a description of the the signature algorithm for XML signatures as defined in http://www.w3.org/TR/xmldsig-core/#sec-AlgID. This description is optional, documents may be signed without it.

Returns:
a description of the the signature algorithm for XML signatures
See Also:
http://www.w3.org/TR/xmldsig-core/#sec-AlgID

getIdentifier

org.bouncycastle.asn1.x509.AlgorithmIdentifier getIdentifier()