|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectanon.crypto.MyRSASignature
public final class MyRSASignature
SHA1withRSA Signature as described in RFC 2437
| Field Summary | |
|---|---|
private org.bouncycastle.crypto.digests.SHA1Digest |
m_Digest
|
private java.security.Key |
m_initKey
The key with that this algorithm has been initialised. |
private org.bouncycastle.crypto.encodings.PKCS1Encoding |
m_SignatureAlgorithm
|
private static org.bouncycastle.asn1.x509.AlgorithmIdentifier |
ms_AlgID
|
private static org.bouncycastle.asn1.x509.AlgorithmIdentifier |
ms_identifier
|
| Constructor Summary | |
|---|---|
MyRSASignature()
|
|
| Method Summary | |
|---|---|
byte[] |
decodeForXMLSignature(byte[] a_encodedSignature)
Tries to decode a signature in a way as it would meet the W3C standard for RSA XML signature values. |
byte[] |
encodeForXMLSignature(byte[] a_signature)
Encodes a signature in a way it meets the W3C standard for RSA XML signature values. |
org.bouncycastle.asn1.x509.AlgorithmIdentifier |
getIdentifier()
Returns the algorithm identifier (RSA with SHA1). |
java.lang.String |
getXMLSignatureAlgorithmReference()
Returns http://www.w3.org/2000/09/xmldsig#rsa-sha1. |
void |
initSign(IMyPrivateKey k)
Initialises the algorithm for signing. |
void |
initVerify(IMyPublicKey k)
Initialises the algorithm for verifying. |
byte[] |
sign(byte[] bytesToSign)
Signs a message and returns the signature. |
byte[] |
signPlain(byte[] hash)
Only does the signature calculation assuming that the input already is a hash |
boolean |
verify(byte[] a_message,
byte[] a_signature)
Tests if the signature of a specified message is valid. |
boolean |
verify(byte[] message,
int message_offset,
int message_len,
byte[] sig,
int signature_offset,
int signature_len)
Tests if the signature of a specified message is valid. |
boolean |
verifyPlain(byte[] hash,
byte[] sig)
Verifyes a signature for a given hash |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static final org.bouncycastle.asn1.x509.AlgorithmIdentifier ms_identifier
private org.bouncycastle.crypto.encodings.PKCS1Encoding m_SignatureAlgorithm
private java.security.Key m_initKey
private org.bouncycastle.crypto.digests.SHA1Digest m_Digest
private static final org.bouncycastle.asn1.x509.AlgorithmIdentifier ms_AlgID
| Constructor Detail |
|---|
public MyRSASignature()
| Method Detail |
|---|
public void initVerify(IMyPublicKey k)
throws java.security.InvalidKeyException
IMySignature
initVerify in interface IMySignaturek - a public key
java.security.InvalidKeyException - if the key is invalid
public void initSign(IMyPrivateKey k)
throws java.security.InvalidKeyException
IMySignature
initSign in interface IMySignaturek - a private key
java.security.InvalidKeyException - if the key is invalid
public boolean verify(byte[] a_message,
byte[] a_signature)
IMySignature
verify in interface IMySignatureverify in interface ISignatureVerificationAlgorithma_message - a messagea_signature - a signature
public boolean verify(byte[] message,
int message_offset,
int message_len,
byte[] sig,
int signature_offset,
int signature_len)
ISignatureVerificationAlgorithm
verify in interface ISignatureVerificationAlgorithmmessage - a messagemessage_offset - start of messagemessage_len - length of messagesig - a signaturesignature_offset - start of signaturesignature_len - length of signature
public boolean verifyPlain(byte[] hash,
byte[] sig)
public byte[] sign(byte[] bytesToSign)
IMySignature
sign in interface IMySignaturesign in interface ISignatureCreationAlgorithmbytesToSign - a message
public byte[] signPlain(byte[] hash)
public org.bouncycastle.asn1.x509.AlgorithmIdentifier getIdentifier()
getIdentifier in interface ISignatureCreationAlgorithmgetIdentifier in interface ISignatureVerificationAlgorithmpublic byte[] encodeForXMLSignature(byte[] a_signature)
encodeForXMLSignature in interface IMySignatureencodeForXMLSignature in interface ISignatureCreationAlgorithma_signature - an non-encoded signature
http://tools.ietf.org/html/rfc2437#section-8.1,
http://www.w3.org/TR/xmldsig-core/#sec-PKCS1public byte[] decodeForXMLSignature(byte[] a_encodedSignature)
decodeForXMLSignature in interface IMySignaturedecodeForXMLSignature in interface ISignatureVerificationAlgorithma_encodedSignature - an encoded signature in PKCS1 format
http://tools.ietf.org/html/rfc2437#section-8.1,
http://www.w3.org/TR/xmldsig-core/#sec-PKCS1public java.lang.String getXMLSignatureAlgorithmReference()
getXMLSignatureAlgorithmReference in interface IMySignaturegetXMLSignatureAlgorithmReference in interface ISignatureCreationAlgorithmgetXMLSignatureAlgorithmReference in interface ISignatureVerificationAlgorithmhttp://www.w3.org/TR/xmldsig-core/#sec-AlgID
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||