Package org.jose4j.jws
Class EcdsaUsingShaAlgorithm
java.lang.Object
org.jose4j.jwa.AlgorithmInfo
org.jose4j.jws.BaseSignatureAlgorithm
org.jose4j.jws.EcdsaUsingShaAlgorithm
- All Implemented Interfaces:
Algorithm,JsonWebSignatureAlgorithm
- Direct Known Subclasses:
EcdsaUsingShaAlgorithm.EcdsaP256UsingSha256,EcdsaUsingShaAlgorithm.EcdsaP384UsingSha384,EcdsaUsingShaAlgorithm.EcdsaP521UsingSha512,EcdsaUsingShaAlgorithm.EcdsaSECP256K1UsingSha256
public class EcdsaUsingShaAlgorithm
extends BaseSignatureAlgorithm
implements JsonWebSignatureAlgorithm
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic classstatic class -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionEcdsaUsingShaAlgorithm(String id, String javaAlgo, String curveName, int signatureByteLength) -
Method Summary
Modifier and TypeMethodDescriptionstatic byte[]convertConcatenatedToDer(byte[] concatenatedSignatureBytes) static byte[]convertDerToConcatenated(byte[] derEncodedBytes, int outputLength) byte[]sign(CryptoPrimitive cryptoPrimitive, byte[] securedInputBytes) private voidvalidateKeySpec(Key key) voidvalidatePrivateKey(PrivateKey privateKey) voidvalidatePublicKey(PublicKey publicKey) booleanverifySignature(byte[] signatureBytes, Key key, byte[] securedInputBytes, ProviderContext providerContext) Methods inherited from class org.jose4j.jws.BaseSignatureAlgorithm
isAvailable, prepareForSign, setAlgorithmParameterSpec, validateSigningKey, validateVerificationKeyMethods inherited from class org.jose4j.jwa.AlgorithmInfo
getAlgorithmIdentifier, getJavaAlgorithm, getKeyPersuasion, getKeyType, setAlgorithmIdentifier, setJavaAlgorithm, setKeyPersuasion, setKeyType, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.jose4j.jwa.Algorithm
getAlgorithmIdentifier, getJavaAlgorithm, getKeyPersuasion, getKeyType, isAvailableMethods inherited from interface org.jose4j.jws.JsonWebSignatureAlgorithm
prepareForSign, validateSigningKey, validateVerificationKey
-
Field Details
-
curveName
-
signatureByteLength
private final int signatureByteLength
-
-
Constructor Details
-
EcdsaUsingShaAlgorithm
-
-
Method Details
-
verifySignature
public boolean verifySignature(byte[] signatureBytes, Key key, byte[] securedInputBytes, ProviderContext providerContext) throws JoseException - Specified by:
verifySignaturein interfaceJsonWebSignatureAlgorithm- Overrides:
verifySignaturein classBaseSignatureAlgorithm- Throws:
JoseException
-
sign
- Specified by:
signin interfaceJsonWebSignatureAlgorithm- Overrides:
signin classBaseSignatureAlgorithm- Throws:
JoseException
-
convertConcatenatedToDer
- Throws:
IOException
-
convertDerToConcatenated
public static byte[] convertDerToConcatenated(byte[] derEncodedBytes, int outputLength) throws IOException - Throws:
IOException
-
validatePrivateKey
- Specified by:
validatePrivateKeyin classBaseSignatureAlgorithm- Throws:
InvalidKeyException
-
validatePublicKey
- Specified by:
validatePublicKeyin classBaseSignatureAlgorithm- Throws:
InvalidKeyException
-
validateKeySpec
- Throws:
InvalidKeyException
-
getCurveName
-