Package org.jose4j.jws
Class BaseSignatureAlgorithm
java.lang.Object
org.jose4j.jwa.AlgorithmInfo
org.jose4j.jws.BaseSignatureAlgorithm
- All Implemented Interfaces:
Algorithm
,JsonWebSignatureAlgorithm
- Direct Known Subclasses:
EcdsaUsingShaAlgorithm
,EdDsaAlgorithm
,RsaUsingShaAlgorithm
public abstract class BaseSignatureAlgorithm
extends AlgorithmInfo
implements JsonWebSignatureAlgorithm
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
prepareForSign
(Key key, ProviderContext providerContext) protected void
setAlgorithmParameterSpec
(AlgorithmParameterSpec algorithmParameterSpec) byte[]
sign
(CryptoPrimitive cryptoPrimitive, byte[] securedInputBytes) abstract void
validatePrivateKey
(PrivateKey privateKey) abstract void
validatePublicKey
(PublicKey publicKey) void
validateSigningKey
(Key key) void
boolean
verifySignature
(byte[] signatureBytes, Key key, byte[] securedInputBytes, ProviderContext providerContext) Methods inherited from class org.jose4j.jwa.AlgorithmInfo
getAlgorithmIdentifier, getJavaAlgorithm, getKeyPersuasion, getKeyType, setAlgorithmIdentifier, setJavaAlgorithm, setKeyPersuasion, setKeyType, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.jose4j.jwa.Algorithm
getAlgorithmIdentifier, getJavaAlgorithm, getKeyPersuasion, getKeyType
-
Constructor Details
-
BaseSignatureAlgorithm
-
-
Method Details
-
setAlgorithmParameterSpec
-
verifySignature
public boolean verifySignature(byte[] signatureBytes, Key key, byte[] securedInputBytes, ProviderContext providerContext) throws JoseException - Specified by:
verifySignature
in interfaceJsonWebSignatureAlgorithm
- Throws:
JoseException
-
prepareForSign
public CryptoPrimitive prepareForSign(Key key, ProviderContext providerContext) throws JoseException - Specified by:
prepareForSign
in interfaceJsonWebSignatureAlgorithm
- Throws:
JoseException
-
sign
- Specified by:
sign
in interfaceJsonWebSignatureAlgorithm
- Throws:
JoseException
-
validatePrivateKey
- Throws:
InvalidKeyException
-
validateSigningKey
- Specified by:
validateSigningKey
in interfaceJsonWebSignatureAlgorithm
- Throws:
InvalidKeyException
-
validatePublicKey
- Throws:
InvalidKeyException
-
validateVerificationKey
- Specified by:
validateVerificationKey
in interfaceJsonWebSignatureAlgorithm
- Throws:
InvalidKeyException
-
isAvailable
public boolean isAvailable()- Specified by:
isAvailable
in interfaceAlgorithm
-