Class KeyWrapper

java.lang.Object
org.keycloak.crypto.KeyWrapper

public class KeyWrapper extends Object
  • Constructor Details

    • KeyWrapper

      public KeyWrapper()
  • Method Details

    • getProviderId

      public String getProviderId()
    • setProviderId

      public void setProviderId(String providerId)
    • getProviderPriority

      public long getProviderPriority()
    • setProviderPriority

      public void setProviderPriority(long providerPriority)
    • getKid

      public String getKid()
    • setKid

      public void setKid(String kid)
    • getAlgorithm

      public String getAlgorithm()

      Returns the value of the optional alg claim.

      Returns:
      the algorithm value
    • getAlgorithmOrDefault

      public String getAlgorithmOrDefault()

      Returns the value of the optional alg claim. If not defined, a default is returned depending on the key type as per kty claim.

      For keys of type KeyType.RSA, the default algorithm is Algorithm.RS256 as this is the default algorithm recommended by OIDC specs.

      Returns:
      the algorithm set or a default based on the key type.
    • setAlgorithm

      public void setAlgorithm(String algorithm)
    • getType

      public String getType()
    • setType

      public void setType(String type)
    • getUse

      public KeyUse getUse()
    • setUse

      public void setUse(KeyUse use)
    • getStatus

      public KeyStatus getStatus()
    • setStatus

      public void setStatus(KeyStatus status)
    • getSecretKey

      public SecretKey getSecretKey()
    • setSecretKey

      public void setSecretKey(SecretKey secretKey)
    • getPrivateKey

      public Key getPrivateKey()
    • setPrivateKey

      public void setPrivateKey(Key privateKey)
    • getPublicKey

      public Key getPublicKey()
    • setPublicKey

      public void setPublicKey(Key publicKey)
    • getCertificate

      public X509Certificate getCertificate()
    • setCertificate

      public void setCertificate(X509Certificate certificate)
    • getCertificateChain

      public List<X509Certificate> getCertificateChain()
    • setCertificateChain

      public void setCertificateChain(List<X509Certificate> certificateChain)
    • isDefaultClientCertificate

      public boolean isDefaultClientCertificate()
    • setIsDefaultClientCertificate

      public void setIsDefaultClientCertificate(boolean isDefaultClientCertificate)
    • cloneKey

      public KeyWrapper cloneKey()