Package org.keycloak.crypto
Class KeyWrapper
- java.lang.Object
-
- org.keycloak.crypto.KeyWrapper
-
public class KeyWrapper extends Object
-
-
Constructor Summary
Constructors Constructor Description KeyWrapper()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description KeyWrappercloneKey()StringgetAlgorithm()Returns the value of the optionalalgclaim.StringgetAlgorithmOrDefault()Returns the value of the optionalalgclaim.X509CertificategetCertificate()List<X509Certificate>getCertificateChain()StringgetKid()KeygetPrivateKey()StringgetProviderId()longgetProviderPriority()KeygetPublicKey()SecretKeygetSecretKey()KeyStatusgetStatus()StringgetType()KeyUsegetUse()voidsetAlgorithm(String algorithm)voidsetCertificate(X509Certificate certificate)voidsetCertificateChain(List<X509Certificate> certificateChain)voidsetKid(String kid)voidsetPrivateKey(Key privateKey)voidsetProviderId(String providerId)voidsetProviderPriority(long providerPriority)voidsetPublicKey(Key publicKey)voidsetSecretKey(SecretKey secretKey)voidsetStatus(KeyStatus status)voidsetType(String type)voidsetUse(KeyUse use)
-
-
-
Method Detail
-
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
algclaim.- Returns:
- the algorithm value
-
getAlgorithmOrDefault
public String getAlgorithmOrDefault()
Returns the value of the optional
algclaim. If not defined, a default is returned depending on the key type as perktyclaim.For keys of type
KeyType.RSA, the default algorithm isAlgorithm.RS256as 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)
-
cloneKey
public KeyWrapper cloneKey()
-
-