JsonWebKey Class
- java.
lang. Object - com.
microsoft. azure. keyvault. webkey. JsonWebKey
- com.
public class JsonWebKey
Method Summary
Modifier and Type | Method and Description |
---|---|
void |
clearMemory()
Clear key materials. |
byte [] |
d()
Get the RSA private exponent value. |
byte [] |
dp()
Get the RSA Private Key Parameter value. |
byte [] |
dq()
Get the RSA Private Key Parameter value. |
byte [] |
e()
Get the RSA public exponent value. |
boolean |
equals(JsonWebKey jwk)
Indicates whether some other JsonWebKey is "equal to" this one. |
boolean | equals(Object obj) |
Json |
fromAes(SecretKey secretKey)
Converts AES key to JSON web key. |
Json |
fromRSA(KeyPair keyPair)
Converts RSA key pair to JSON web key. |
int | hashCode() |
boolean |
hasPrivateKey()
Verifies whether the JsonWebKey has private key. |
boolean |
isValid()
Verifies whether the JsonWebKey is valid. |
byte [] |
k()
Get Symmetric key value. |
List<Json |
keyOps()
Get the key operations. |
String |
kid()
Key Identifier. |
Json |
kty()
Key type, usually RSA. Possible values include: 'EC', 'RSA', 'RSA-HSM', 'oct'. |
byte [] |
n()
Get the RSA modulus value. |
byte [] |
p()
Get the RSA secret prime value. |
byte [] |
q()
Get RSA secret prime, with p <q value. |
byte [] |
qi()
Get the RSA Private Key Parameter value. |
byte [] |
t()
Get HSM Token value, used with Bring Your Own Key. |
SecretKey |
toAes()
Converts JSON web key to AES key. |
KeyPair |
toRSA()
Converts JSON web key to RSA key pair. |
KeyPair |
toRSA(boolean includePrivateParameters)
Converts JSON web key to RSA key pair and include the private key if set to true. |
KeyPair |
toRSA(boolean includePrivateParameters, Provider provider)
Converts JSON web key to RSA key pair and include the private key if set to true. |
String | toString() |
Json |
withD(byte[] d)
Set RSA private exponent value. |
Json |
withDp(byte[] dp)
Set RSA Private Key Parameter value. |
Json |
withDq(byte[] dq)
Set RSA Private Key Parameter value . |
Json |
withE(byte[] e)
Set the RSA public exponent value. |
Json |
withK(byte[] k)
Set the Symmetric key value. |
Json |
withKeyOps(List<JsonWebKeyOperation> keyOps)
Set the key operations value. |
Json |
withKid(String kid)
Set the key identifier value. |
Json |
withKty(JsonWebKeyType kty)
Set the key type value. |
Json |
withN(byte[] n)
Set the RSA modulus value. |
Json |
withP(byte[] p)
Set the RSA secret prime value. |
Json |
withQ(byte[] q)
Set the RSA secret prime, with p <q value. |
Json |
withQi(byte[] qi)
Set RSA Private Key Parameter value. |
Json |
withT(byte[] t)
Set HSM Token value, used with Bring Your Own Key. |
Method Details
clearMemory
public void clearMemory()
Clear key materials.
d
public byte [] d()
Get the RSA private exponent value.
Returns:
dp
public byte [] dp()
Get the RSA Private Key Parameter value.
Returns:
dq
public byte [] dq()
Get the RSA Private Key Parameter value.
Returns:
e
public byte [] e()
Get the RSA public exponent value.
Returns:
equals
public boolean equals(JsonWebKey jwk)
Indicates whether some other JsonWebKey is "equal to" this one.
Parameters:
Returns:
equals
public boolean equals(Object obj)
Parameters:
fromAes
public static JsonWebKey fromAes(SecretKey secretKey)
Converts AES key to JSON web key.
Parameters:
Returns:
fromRSA
public static JsonWebKey fromRSA(KeyPair keyPair)
Converts RSA key pair to JSON web key.
Parameters:
Returns:
hashCode
public int hashCode()
hasPrivateKey
public boolean hasPrivateKey()
Verifies whether the JsonWebKey has private key.
Returns:
isValid
public boolean isValid()
Verifies whether the JsonWebKey is valid.
Returns:
k
public byte [] k()
Get Symmetric key value.
Returns:
keyOps
public List
Get the key operations.
Returns:
kid
public String kid()
Key Identifier.
Returns:
kty
public JsonWebKeyType kty()
Key type, usually RSA. Possible values include: 'EC', 'RSA', 'RSA-HSM', 'oct'.
Returns:
n
public byte [] n()
Get the RSA modulus value.
Returns:
p
public byte [] p()
Get the RSA secret prime value.
Returns:
q
public byte [] q()
Get RSA secret prime, with p <q value.
Returns:
qi
public byte [] qi()
Get the RSA Private Key Parameter value.
Returns:
t
public byte [] t()
Get HSM Token value, used with Bring Your Own Key.
Returns:
toAes
public SecretKey toAes()
Converts JSON web key to AES key.
Returns:
toRSA
public KeyPair toRSA()
Converts JSON web key to RSA key pair.
Returns:
toRSA
public KeyPair toRSA(boolean includePrivateParameters)
Converts JSON web key to RSA key pair and include the private key if set to true.
Parameters:
Returns:
toRSA
public KeyPair toRSA(boolean includePrivateParameters, Provider provider)
Converts JSON web key to RSA key pair and include the private key if set to true.
Parameters:
Returns:
toString
public String toString()
withD
public JsonWebKey withD(byte[] d)
Set RSA private exponent value.
Parameters:
Returns:
withDp
public JsonWebKey withDp(byte[] dp)
Set RSA Private Key Parameter value.
Parameters:
Returns:
withDq
public JsonWebKey withDq(byte[] dq)
Set RSA Private Key Parameter value .
Parameters:
Returns:
withE
public JsonWebKey withE(byte[] e)
Set the RSA public exponent value.
Parameters:
Returns:
withK
public JsonWebKey withK(byte[] k)
Set the Symmetric key value.
Parameters:
Returns:
withKeyOps
public JsonWebKey withKeyOps(List
Set the key operations value.
Parameters:
Returns:
withKid
public JsonWebKey withKid(String kid)
Set the key identifier value.
Parameters:
Returns:
withKty
public JsonWebKey withKty(JsonWebKeyType kty)
Set the key type value.
Parameters:
Returns:
withN
public JsonWebKey withN(byte[] n)
Set the RSA modulus value.
Parameters:
Returns:
withP
public JsonWebKey withP(byte[] p)
Set the RSA secret prime value.
Parameters:
Returns:
withQ
public JsonWebKey withQ(byte[] q)
Set the RSA secret prime, with p <q value.
Parameters:
Returns:
withQi
public JsonWebKey withQi(byte[] qi)
Set RSA Private Key Parameter value.
Parameters:
Returns:
withT
public JsonWebKey withT(byte[] t)
Set HSM Token value, used with Bring Your Own Key.
Parameters:
Returns:
Applies to
Azure SDK for Java