Package io.fusionauth.jwt.ec
Class ECDSASignature
java.lang.Object
io.fusionauth.jwt.ec.ECDSASignature
Handle encoding and decoding an ECDSA signature.
The DER encoded ECDSA signature structure is as follows:
s byte array
|
Length of s byte array |
| |
Integer Tag | |
Sequence Tag | | |
| | | |
DER Encoded ECDSA Signature: | 0x30 | lenZ | 0x02 | len(r) | r | 0x02 | len(s) | s
| | | |
Length of the remaining byte array | | |
| | |
Integer Tag | |
| |
Length of r byte array |
|
- Author:
- Daniel DeGroff
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbyte[]Accept a DER encoded signature and extract the 'r' and the 's' components of the Elliptic signature.byte[]Accept an ECDSA encoded signature of the 'r' and 's' elliptic components, return these values DER encoded.
-
Constructor Details
-
ECDSASignature
public ECDSASignature(byte[] bytes)
-
-
Method Details
-
derDecode
Accept a DER encoded signature and extract the 'r' and the 's' components of the Elliptic signature.- Parameters:
algorithm- the signature algorithm used- Returns:
- a byte array containing the 'r' and the 's' elliptic signature components.
- Throws:
IOException- when $%@! gets real.
-
derEncode
Accept an ECDSA encoded signature of the 'r' and 's' elliptic components, return these values DER encoded.- Returns:
- a DER encoded sequence containing the 'r' and the 's' elliptic signature components
- Throws:
IOException- when $%@! gets real.
-