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

public class EC2COSEKey extends AbstractCOSEKey
  • Constructor Details

    • EC2COSEKey

      public EC2COSEKey(@Nullable @org.jetbrains.annotations.Nullable byte[] keyId, @Nullable @Nullable COSEAlgorithmIdentifier algorithm, @Nullable @Nullable List<COSEKeyOperation> keyOps, @Nullable @Nullable Curve curve, @Nullable @org.jetbrains.annotations.Nullable byte[] x, @Nullable @org.jetbrains.annotations.Nullable byte[] y, @Nullable @org.jetbrains.annotations.Nullable byte[] d)
      Constructor for key pair
      Parameters:
      keyId - keyId
      algorithm - algorithm
      keyOps - keyOps
      curve - curve
      x - x
      y - y
      d - d
    • EC2COSEKey

      public EC2COSEKey(@Nullable @org.jetbrains.annotations.Nullable byte[] keyId, @Nullable @Nullable COSEAlgorithmIdentifier algorithm, @Nullable @Nullable List<COSEKeyOperation> keyOps, @Nullable @Nullable Curve curve, @Nullable @org.jetbrains.annotations.Nullable byte[] x, @Nullable @org.jetbrains.annotations.Nullable byte[] y)
      Constructor for public key
      Parameters:
      keyId - keyId
      algorithm - algorithm
      keyOps - keyOps
      curve - curve
      x - x
      y - y
    • EC2COSEKey

      public EC2COSEKey(@Nullable @org.jetbrains.annotations.Nullable byte[] keyId, @Nullable @Nullable COSEAlgorithmIdentifier algorithm, @Nullable @Nullable List<COSEKeyOperation> keyOps, @Nullable @Nullable Curve curve, @Nullable @org.jetbrains.annotations.Nullable byte[] d)
      Constructor for public key
      Parameters:
      keyId - keyId
      algorithm - algorithm
      keyOps - keyOps
      curve - curve
      d - d
  • Method Details

    • create

      @NotNull public static @NotNull EC2COSEKey create(@NotNull @NotNull ECPrivateKey privateKey, @Nullable @Nullable COSEAlgorithmIdentifier alg)
    • create

      @NotNull public static @NotNull EC2COSEKey create(@NotNull @NotNull ECPublicKey publicKey, @Nullable @Nullable COSEAlgorithmIdentifier alg)
    • create

      @NotNull public static @NotNull EC2COSEKey create(@NotNull @NotNull KeyPair keyPair, @Nullable @Nullable COSEAlgorithmIdentifier alg)
    • create

      @NotNull public static @NotNull EC2COSEKey create(@NotNull @NotNull ECPrivateKey privateKey)
      Parameters:
      privateKey - private key
      Returns:
      EC2COSEKey
    • create

      @NotNull public static @NotNull EC2COSEKey create(@NotNull @NotNull ECPublicKey publicKey)
      Create EC2COSEKey from ECPublicKey.
      Parameters:
      publicKey - public key
      Returns:
      EC2COSEKey
    • create

      @NotNull public static @NotNull EC2COSEKey create(@NotNull @NotNull KeyPair keyPair)
      Create EC2COSEKey from KeyPair.
      Parameters:
      keyPair - key pair
      Returns:
      EC2COSEKey
    • createFromUncompressedECCKey

      @NotNull public static @NotNull EC2COSEKey createFromUncompressedECCKey(@NotNull @org.jetbrains.annotations.NotNull byte[] publicKey)
      create from uncompressed ECC 256-bit key
      Parameters:
      publicKey - public key
      Returns:
      EC2COSEKey
    • getKeyType

      @NotNull public @NotNull COSEKeyType getKeyType()
      Specified by:
      getKeyType in interface COSEKey
      Specified by:
      getKeyType in class AbstractCOSEKey
    • getCurve

      @Nullable public @Nullable Curve getCurve()
    • getX

      @Nullable public @org.jetbrains.annotations.Nullable byte[] getX()
    • getY

      @Nullable public @org.jetbrains.annotations.Nullable byte[] getY()
    • getD

      @Nullable public @org.jetbrains.annotations.Nullable byte[] getD()
    • getPublicKey

      @Nullable public @Nullable PublicKey getPublicKey()
    • getPrivateKey

      @Nullable public @Nullable PrivateKey getPrivateKey()
    • hasPublicKey

      public boolean hasPublicKey()
    • hasPrivateKey

      public boolean hasPrivateKey()
    • 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