sign
public boolean sign(@NonNull
EiffelEvent event)
throws InvalidCertificateConfigurationException,
InvalidKeyException,
JsonCanonicalizationException,
KeyStoreException,
NoSuchAlgorithmException,
SignatureException,
UnrecoverableKeyException,
UnsupportedAlgorithmException
Request signing of the given event using a private key and identity.
Based on its configuration, the implementation may choose to not
sign the event.
- Specified by:
sign
in interface EventSigner
- Parameters:
event
- the EiffelEvent
to sign in place
- Returns:
- true if the event was signed, false otherwise
- Throws:
InvalidCertificateConfigurationException
- if the keystore in the certificate credential was entirely
empty or its first item didn't contain a certificate with a private key
InvalidKeyException
- if the given private key was invalid
JsonCanonicalizationException
- if there was an error serializing the event to canonical JSON form
KeyStoreException
- if the KeyStore
hasn't been initialized
(shouldn't happen and indicates a bug)
NoSuchAlgorithmException
- if the algorithm needed to decrypt the key isn't available
SignatureException
- if there's a general problem in the signing process
UnrecoverableKeyException
- if the key couldn't be decrypted, e.g. because the password is wrong
UnsupportedAlgorithmException
- if the credential's signature algorithm isn't supported
by this implementation of the Eiffel protocol or the available cryptography provider