java.lang.Object
com.webauthn4j.data.attestation.authenticator.AbstractCOSEKey
com.webauthn4j.data.attestation.authenticator.RSACOSEKey
All Implemented Interfaces:
COSEKey

public class RSACOSEKey extends AbstractCOSEKey
  • 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 - keyId
      algorithm - algorithm
      keyOps - keyOps
      n - the RSA modulus n
      e - the RSA public exponent e
      d - the RSA private exponent d
      p - the prime factor p of n
      q - the prime factor q of n
      dP - 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 - keyId
      algorithm - algorithm
      keyOps - keyOps
      n - n
      e - 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

      @NotNull public static @NotNull RSACOSEKey create(@NotNull @NotNull RSAPrivateKey privateKey)
      Parameters:
      privateKey - privateKey
      Returns:
      RSACOSEKey
    • create

      @NotNull public static @NotNull RSACOSEKey create(@NotNull @NotNull RSAPublicKey publicKey)
      Parameters:
      publicKey - publicKey
      Returns:
      RSACOSEKey
    • create

      @NotNull public static @NotNull RSACOSEKey create(@NotNull @NotNull KeyPair keyPair)
      Create RSACOSEKey from KeyPair.
      Parameters:
      keyPair - keyPair
      Returns:
      RSACOSEKey
    • getKeyType

      @NotNull public @NotNull COSEKeyType getKeyType()
      Specified by:
      getKeyType in interface COSEKey
      Specified by:
      getKeyType in class AbstractCOSEKey
    • 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

      @Nullable public @Nullable PublicKey getPublicKey()
    • getPrivateKey

      @Nullable public @Nullable PrivateKey getPrivateKey()
    • validate

      public void validate()
    • equals

      public boolean equals(@Nullable @Nullable Object o)
      Overrides:
      equals in class AbstractCOSEKey
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class AbstractCOSEKey
    • toString

      public String toString()
      Overrides:
      toString in class Object