Package com.google.crypto.tink.jwt
Class JwtEcdsaPrivateKey
- java.lang.Object
-
- com.google.crypto.tink.Key
-
- com.google.crypto.tink.jwt.JwtSignaturePrivateKey
-
- com.google.crypto.tink.jwt.JwtEcdsaPrivateKey
-
- All Implemented Interfaces:
PrivateKey
@Immutable public final class JwtEcdsaPrivateKey extends JwtSignaturePrivateKey
Represents a key for computing JWT ECDSA signatures (ES256, ES384, ES512).See https://datatracker.ietf.org/doc/html/rfc7518 for more information.
-
-
Field Summary
Fields Modifier and Type Field Description SecretBigIntegerprivateKeyValueJwtEcdsaPublicKeypublicKey
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static JwtEcdsaPrivateKeycreate(JwtEcdsaPublicKey publicKey, SecretBigInteger privateValue)booleanequalsKey(Key o)Returns true if the key is guaranteed to be equal toother.JwtEcdsaParametersgetParameters()Returns aParametersobject containing all the information about the key which is not randomly chosen.SecretBigIntegergetPrivateValue()JwtEcdsaPublicKeygetPublicKey()-
Methods inherited from class com.google.crypto.tink.jwt.JwtSignaturePrivateKey
getIdRequirementOrNull, getKid
-
-
-
-
Field Detail
-
publicKey
public final JwtEcdsaPublicKey publicKey
-
privateKeyValue
public final SecretBigInteger privateKeyValue
-
-
Method Detail
-
create
public static JwtEcdsaPrivateKey create(JwtEcdsaPublicKey publicKey, SecretBigInteger privateValue) throws java.security.GeneralSecurityException
- Throws:
java.security.GeneralSecurityException
-
getPrivateValue
public SecretBigInteger getPrivateValue()
-
getParameters
public JwtEcdsaParameters getParameters()
Description copied from class:KeyReturns aParametersobject containing all the information about the key which is not randomly chosen.Implementations need to ensure that
getParameters().hasIdRequirement()returns true if and only ifgetIdRequirementOrNullis non-null.- Specified by:
getParametersin classJwtSignaturePrivateKey
-
getPublicKey
public JwtEcdsaPublicKey getPublicKey()
- Specified by:
getPublicKeyin interfacePrivateKey- Specified by:
getPublicKeyin classJwtSignaturePrivateKey
-
equalsKey
public boolean equalsKey(Key o)
Description copied from class:KeyReturns true if the key is guaranteed to be equal toother.Implementations are required to do this in constant time.
Note: this is allowed to return false even if two keys are guaranteed to represent the same function, but are represented differently. For example, a key is allowed to internally store the number of zero-bytes used as padding when a large number is represented as a byte array, and use this in the comparison.
Note: Tink
Keyobjects should typically not overridehashCode(because it could risk leaking key material). Hence, they typically also should not overrideequals.
-
-