Package org.bouncycastle.crypto.signers
Class ECCSISigner
java.lang.Object
org.bouncycastle.crypto.signers.ECCSISigner
- All Implemented Interfaces:
Signer
Implementation of Elliptic Curve-based Certificateless Signatures for Identity-Based Encryption (ECCSI)
as defined in RFC 6507.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionECCSISigner
(ECPoint kpak, X9ECParameters params, Digest digest, byte[] id) Constructs an ECCSI signer/verifier with KMS Public Authentication Key and user identity. -
Method Summary
Modifier and TypeMethodDescriptionbyte[]
Generates an ECCSI signature according to RFC 6507 Section 5.2.1.void
init
(boolean forSigning, CipherParameters param) Initializes the signer for either signature generation or verification.void
reset()
Resets the signer/verifier state and performs initial computations: - For signing: Validates KPAK consistency (RFC 6507 Section 5.1.2) - For verification: Computes Y = HS·PVT + KPAK Also computes HS = hash(G || KPAK || ID || PVT) as per RFC 6507 Section 5.1.1void
update
(byte b) update the internal digest with the byte bvoid
update
(byte[] in, int off, int len) update the internal digest with the byte array inboolean
verifySignature
(byte[] signature) Verifies an ECCSI signature according to RFC 6507 Section 5.2.2.
-
Constructor Details
-
ECCSISigner
Constructs an ECCSI signer/verifier with KMS Public Authentication Key and user identity.- Parameters:
kpak
- KMS Public Authentication Key (KPAK) from RFC 6507 Section 2id
- User identity byte array formatted
-
-
Method Details
-
init
Initializes the signer for either signature generation or verification.- Specified by:
init
in interfaceSigner
- Parameters:
forSigning
- true for signing, false for verificationparam
- Key parameters: - For signing:ParametersWithRandom
containingECCSIPrivateKeyParameters
- For verification:ECCSIPublicKeyParameters
- Throws:
IllegalArgumentException
- if invalid parameters are provided
-
update
public void update(byte b) Description copied from interface:Signer
update the internal digest with the byte b -
update
public void update(byte[] in, int off, int len) Description copied from interface:Signer
update the internal digest with the byte array in -
generateSignature
Generates an ECCSI signature according to RFC 6507 Section 5.2.1.- Specified by:
generateSignature
in interfaceSigner
- Returns:
- Signature structure containing: - r (N bytes) - s (N bytes) - PVT (Public Validation Token)
- Throws:
CryptoException
- if cryptographic operations failDataLengthException
- if input data is invalidIllegalArgumentException
- if invalid SSK or j parameter is detected
-
verifySignature
public boolean verifySignature(byte[] signature) Verifies an ECCSI signature according to RFC 6507 Section 5.2.2.- Specified by:
verifySignature
in interfaceSigner
- Parameters:
signature
- Signature to verify (r || s || PVT)- Returns:
- true if signature is valid, false otherwise
- Throws:
IllegalArgumentException
- if signature format is invalid
-
reset
public void reset()Resets the signer/verifier state and performs initial computations: - For signing: Validates KPAK consistency (RFC 6507 Section 5.1.2) - For verification: Computes Y = HS·PVT + KPAK Also computes HS = hash(G || KPAK || ID || PVT) as per RFC 6507 Section 5.1.1
-