java.lang.Object
com.webauthn4j.data.attestation.authenticator.AbstractCOSEKey
com.webauthn4j.data.attestation.authenticator.RSACOSEKey
- All Implemented Interfaces:
COSEKey
-
Constructor Summary
ConstructorsConstructorDescriptionRSACOSEKey(@org.jetbrains.annotations.Nullable byte[] keyId, @Nullable COSEAlgorithmIdentifier algorithm, @Nullable List<COSEKeyOperation> keyOps, @org.jetbrains.annotations.Nullable byte[] n, @org.jetbrains.annotations.Nullable byte[] e) Constructor for public keyRSACOSEKey(@org.jetbrains.annotations.Nullable byte[] keyId, @Nullable COSEAlgorithmIdentifier algorithm, @Nullable List<COSEKeyOperation> keyOps, @org.jetbrains.annotations.Nullable byte[] n, @org.jetbrains.annotations.Nullable byte[] e, @org.jetbrains.annotations.Nullable byte[] d, @org.jetbrains.annotations.Nullable byte[] p, @org.jetbrains.annotations.Nullable byte[] q, @org.jetbrains.annotations.Nullable byte[] dP, @org.jetbrains.annotations.Nullable byte[] dQ, @org.jetbrains.annotations.Nullable byte[] qInv) Constructor for key pair -
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull RSACOSEKeycreate(@NotNull RSAPrivateKey privateKey) CreateRSACOSEKeyfromRSAPrivateKey.static @NotNull RSACOSEKeycreate(@NotNull RSAPrivateKey privateKey, @Nullable COSEAlgorithmIdentifier alg) static @NotNull RSACOSEKeycreate(@NotNull RSAPublicKey publicKey) CreateRSACOSEKeyfromRSAPublicKey.static @NotNull RSACOSEKeycreate(@NotNull RSAPublicKey publicKey, @Nullable COSEAlgorithmIdentifier alg) static @NotNull RSACOSEKeyCreateRSACOSEKeyfromKeyPair.static @NotNull RSACOSEKeycreate(@NotNull KeyPair keyPair, @Nullable COSEAlgorithmIdentifier alg) boolean@org.jetbrains.annotations.Nullable byte[]getD()@org.jetbrains.annotations.Nullable byte[]getDP()@org.jetbrains.annotations.Nullable byte[]getDQ()@org.jetbrains.annotations.Nullable byte[]getE()@NotNull COSEKeyType@org.jetbrains.annotations.Nullable byte[]getN()@org.jetbrains.annotations.Nullable byte[]getP()@Nullable PrivateKey@Nullable PublicKey@org.jetbrains.annotations.Nullable byte[]getQ()@org.jetbrains.annotations.Nullable byte[]getQInv()inthashCode()booleanbooleantoString()voidvalidate()Methods inherited from class com.webauthn4j.data.attestation.authenticator.AbstractCOSEKey
getAlgorithm, getBaseIV, getKeyId, getKeyOps
-
Constructor Details
-
RSACOSEKey
public RSACOSEKey(@Nullable @org.jetbrains.annotations.Nullable byte[] keyId, @Nullable @Nullable COSEAlgorithmIdentifier algorithm, @Nullable @Nullable List<COSEKeyOperation> keyOps, @Nullable @org.jetbrains.annotations.Nullable byte[] n, @Nullable @org.jetbrains.annotations.Nullable byte[] e, @Nullable @org.jetbrains.annotations.Nullable byte[] d, @Nullable @org.jetbrains.annotations.Nullable byte[] p, @Nullable @org.jetbrains.annotations.Nullable byte[] q, @Nullable @org.jetbrains.annotations.Nullable byte[] dP, @Nullable @org.jetbrains.annotations.Nullable byte[] dQ, @Nullable @org.jetbrains.annotations.Nullable byte[] qInv) Constructor for key pair- Parameters:
keyId- keyIdalgorithm- algorithmkeyOps- keyOpsn- the RSA modulus ne- the RSA public exponent ed- the RSA private exponent dp- the prime factor p of nq- the prime factor q of ndP- dP is d mod (p - 1)dQ- dQ is d mod (q - 1)qInv- qInv is the CRT coefficient q^(-1) mod p
-
RSACOSEKey
public RSACOSEKey(@Nullable @org.jetbrains.annotations.Nullable byte[] keyId, @Nullable @Nullable COSEAlgorithmIdentifier algorithm, @Nullable @Nullable List<COSEKeyOperation> keyOps, @Nullable @org.jetbrains.annotations.Nullable byte[] n, @Nullable @org.jetbrains.annotations.Nullable byte[] e) Constructor for public key- Parameters:
keyId- keyIdalgorithm- algorithmkeyOps- keyOpsn- ne- e
-
-
Method Details
-
create
@NotNull public static @NotNull RSACOSEKey create(@NotNull @NotNull RSAPrivateKey privateKey, @Nullable @Nullable COSEAlgorithmIdentifier alg) -
create
@NotNull public static @NotNull RSACOSEKey create(@NotNull @NotNull RSAPublicKey publicKey, @Nullable @Nullable COSEAlgorithmIdentifier alg) -
create
@NotNull public static @NotNull RSACOSEKey create(@NotNull @NotNull KeyPair keyPair, @Nullable @Nullable COSEAlgorithmIdentifier alg) -
create
CreateRSACOSEKeyfromRSAPrivateKey.- Parameters:
privateKey- privateKey- Returns:
RSACOSEKey
-
create
CreateRSACOSEKeyfromRSAPublicKey.- Parameters:
publicKey- publicKey- Returns:
RSACOSEKey
-
create
CreateRSACOSEKeyfromKeyPair.- Parameters:
keyPair- keyPair- Returns:
RSACOSEKey
-
getKeyType
- Specified by:
getKeyTypein interfaceCOSEKey- Specified by:
getKeyTypein classAbstractCOSEKey
-
getN
@Nullable public @org.jetbrains.annotations.Nullable byte[] getN() -
getE
@Nullable public @org.jetbrains.annotations.Nullable byte[] getE() -
getD
@Nullable public @org.jetbrains.annotations.Nullable byte[] getD() -
getP
@Nullable public @org.jetbrains.annotations.Nullable byte[] getP() -
getQ
@Nullable public @org.jetbrains.annotations.Nullable byte[] getQ() -
getDP
@Nullable public @org.jetbrains.annotations.Nullable byte[] getDP() -
getDQ
@Nullable public @org.jetbrains.annotations.Nullable byte[] getDQ() -
getQInv
@Nullable public @org.jetbrains.annotations.Nullable byte[] getQInv() -
hasPublicKey
public boolean hasPublicKey() -
hasPrivateKey
public boolean hasPrivateKey() -
getPublicKey
-
getPrivateKey
-
validate
public void validate() -
equals
- Overrides:
equalsin classAbstractCOSEKey
-
hashCode
public int hashCode()- Overrides:
hashCodein classAbstractCOSEKey
-
toString
-