Interface AsymmetricJWK

  • All Known Implementing Classes:
    ECKey, OctetKeyPair, RSAKey

    public interface AsymmetricJWK
    Asymmetric (pair) JSON Web Key (JWK).
    Version:
    2018-02-27
    Author:
    Vladimir Dzhuvinov
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      boolean matches​(java.security.cert.X509Certificate cert)
      Returns true if the public key material of this JWK matches the public subject key info of the specified X.509 certificate.
      java.security.KeyPair toKeyPair()
      Returns a Java key pair representation of this JWK.
      java.security.PrivateKey toPrivateKey()
      Returns a Java private key representation of this JWK.
      java.security.PublicKey toPublicKey()
      Returns a Java public key representation of the JWK.
    • Method Detail

      • toPublicKey

        java.security.PublicKey toPublicKey()
                                     throws JOSEException
        Returns a Java public key representation of the JWK.
        Returns:
        The Java public key.
        Throws:
        JOSEException - If conversion failed or is not supported.
      • toPrivateKey

        java.security.PrivateKey toPrivateKey()
                                       throws JOSEException
        Returns a Java private key representation of this JWK.
        Returns:
        The Java private key, null if not specified.
        Throws:
        JOSEException - If conversion failed or is not supported.
      • toKeyPair

        java.security.KeyPair toKeyPair()
                                 throws JOSEException
        Returns a Java key pair representation of this JWK.
        Returns:
        The Java key pair. The private key will be null if not specified.
        Throws:
        JOSEException - If conversion failed or is not supported.
      • matches

        boolean matches​(java.security.cert.X509Certificate cert)
        Returns true if the public key material of this JWK matches the public subject key info of the specified X.509 certificate.
        Parameters:
        cert - The X.509 certificate. Must not be null.
        Returns:
        true if the public key material of this JWK matches the public subject key info of the specified X.509 certificate, else false.