|
IAIK ECC version 2.18 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object iaik.security.ecc.util.SignatureFormater
A collection of methods used to format the ECDSA signature
Constructor Summary | |
SignatureFormater(byte[] signature)
Parses a DER encoded signature of the format: ECDSA-Sig-Value ::= SEQUENCE { r INTEGER, s INTEGER } |
Method Summary | |
static byte[] |
asn1toRawRS(byte[] sigBytes,
int lengthRS)
This method decodes an X.509 ECDSA signature and returns the raw r and s values in a byte array. |
java.math.BigInteger |
getR()
|
java.math.BigInteger |
getS()
|
static byte[] |
getSignature(java.math.BigInteger r,
java.math.BigInteger s)
ECDSA-Sig-Value ::= SEQUENCE { r INTEGER, s INTEGER } |
static byte[] |
rawRStoASN1(byte[] rs)
This method encodes the raw r and s values of a ECDSA signature into an X.509 signature. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SignatureFormater(byte[] signature) throws java.lang.Exception
ECDSA-Sig-Value ::= SEQUENCE { r INTEGER, s INTEGER }
signature
- the byte array containing the signatureMethod Detail |
public static byte[] getSignature(java.math.BigInteger r, java.math.BigInteger s)
ECDSA-Sig-Value ::= SEQUENCE { r INTEGER, s INTEGER }
public static byte[] rawRStoASN1(byte[] rs) throws java.security.SignatureException
rs
- The byte array containing the concatenation of r and s,
most significant byte first (no signum bits).
java.security.SignatureException
- If encoding the signature value fails.public static byte[] asn1toRawRS(byte[] sigBytes, int lengthRS) throws java.security.SignatureException
sigBytes
- The X.509 encoded ECDSA signature value.lengthRS
- The length of R and S in bytes, which have both the same
length; e.g. 20 bytes.
If this is 0, the byte length of r and s will be
determined and the longer of both will be taken.
java.security.SignatureException
- If decoding the signature value fails.public java.math.BigInteger getR()
public java.math.BigInteger getS()
|
IAIK ECC version 2.18 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |