Class UserEventSigner
java.lang.Object
com.axis.jenkins.plugins.eiffel.eiffelbroadcaster.signing.EventSigner
com.axis.jenkins.plugins.eiffel.eiffelbroadcaster.signing.UserEventSigner
Signs an event using credentials tied to a
Run
. This is
obviously only available during a specific build.-
Constructor Summary
ConstructorDescriptionUserEventSigner
(String credentialsId, HashAlgorithm hashAlgorithm, Run<?, ?> run) -
Method Summary
Modifier and TypeMethodDescriptionRun<?,
?> getRun()
boolean
sign
(EiffelEvent event) Request signing of the given event using a private key and identity.
-
Constructor Details
-
UserEventSigner
public UserEventSigner(@NonNull String credentialsId, @NonNull HashAlgorithm hashAlgorithm, @NonNull Run<?, ?> run)
-
-
Method Details
-
getCredentialsId
-
getHashAlgorithm
-
getRun
-
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 classEventSigner
- Parameters:
event
- theEiffelEvent
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 keyInvalidKeyException
- if the given private key was invalidJsonCanonicalizationException
- if there was an error serializing the event to canonical JSON formKeyStoreException
- if theKeyStore
hasn't been initialized (shouldn't happen and indicates a bug)NoSuchAlgorithmException
- if the algorithm needed to decrypt the key isn't availableSignatureException
- if there's a general problem in the signing processUnrecoverableKeyException
- if the key couldn't be decrypted, e.g. because the password is wrongUnsupportedAlgorithmException
- if the credential's signature algorithm isn't supported by this implementation of the Eiffel protocol or the available cryptography provider
-