anon.crypto
Interface ISignatureCreationAlgorithm

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

public interface ISignatureCreationAlgorithm

This interface represents an algorithm that creates cryptographic signatures.


Method Summary
 byte[] encodeForXMLSignature(byte[] a_signature)
          Encodes a signature in a way it meets the W3C standard for XML signature values.
 org.bouncycastle.asn1.x509.AlgorithmIdentifier getIdentifier()
          Returns the algorithm identifier.
 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.
 byte[] sign(byte[] a_message)
          Signs a message and returns the signature.
 

Method Detail

sign

byte[] sign(byte[] a_message)
Signs a message and returns the signature.

Parameters:
a_message - a message
Returns:
the signature that was created

encodeForXMLSignature

byte[] encodeForXMLSignature(byte[] a_signature)
Encodes a signature in a way it meets the W3C standard for XML signature values. Without this encoding, RSA XML signatures cannot be created.

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

getIdentifier

org.bouncycastle.asn1.x509.AlgorithmIdentifier getIdentifier()
Returns the algorithm identifier.

Returns:
the algorithm identifier

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