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 KeyWrapper
cloneKey()
String
getAlgorithm()
Returns the value of the optionalalg
claim.String
getAlgorithmOrDefault()
Returns the value of the optionalalg
claim.X509Certificate
getCertificate()
List<X509Certificate>
getCertificateChain()
String
getKid()
Key
getPrivateKey()
String
getProviderId()
long
getProviderPriority()
Key
getPublicKey()
SecretKey
getSecretKey()
KeyStatus
getStatus()
String
getType()
KeyUse
getUse()
void
setAlgorithm(String algorithm)
void
setCertificate(X509Certificate certificate)
void
setCertificateChain(List<X509Certificate> certificateChain)
void
setKid(String kid)
void
setPrivateKey(Key privateKey)
void
setProviderId(String providerId)
void
setProviderPriority(long providerPriority)
void
setPublicKey(Key publicKey)
void
setSecretKey(SecretKey secretKey)
void
setStatus(KeyStatus status)
void
setType(String type)
void
setUse(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
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 perkty
claim.For keys of type
KeyType.RSA
, the default algorithm isAlgorithm.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)
-
cloneKey
public KeyWrapper cloneKey()
-
-