Class HskCreateRequest
- java.lang.Object
-
- com.authlete.common.dto.HskCreateRequest
-
- All Implemented Interfaces:
Serializable
public class HskCreateRequest extends Object implements Serializable
Request to Authlete's/api/hsk/createAPI.Note that parameter values specified in the request to the API cannot be changed later. Especially, the key ID cannot be changed later. Therefore, if you explicitly specify a key ID in the request, the value has to be determined carefully before calling the
/api/hsk/createAPI.- Since:
- 2.97
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description HskCreateRequest()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetAlg()Get the algorithm of the key on the HSM.StringgetHsmName()Get the name of the HSM.StringgetKid()Get the key ID for the key on the HSM.StringgetKty()Get the key type.StringgetUse()Get the use of the key on the HSM.HskCreateRequestsetAlg(String alg)Set the algorithm of the key on the HSM.HskCreateRequestsetHsmName(String hsmName)Set the name of the HSM.HskCreateRequestsetKid(String kid)Set the key ID for the key on the HSM.HskCreateRequestsetKty(String kty)Set the key type.HskCreateRequestsetUse(String use)Set the use of the key on the HSM.
-
-
-
Method Detail
-
getKty
public String getKty()
Get the key type.- Returns:
- The key type.
"EC"or"RSA". - See Also:
- RFC 7517 JSON Web Key (JWK), 4.1. "kty" (Key Type) Parameter
-
setKty
public HskCreateRequest setKty(String kty)
Set the key type.- Parameters:
kty- The key type."EC"or"RSA".- Returns:
thisobject.- See Also:
- RFC 7517 JSON Web Key (JWK), 4.1. "kty" (Key Type) Parameter
-
getUse
public String getUse()
Get the use of the key on the HSM.When the key use is
"sig"(signature), the private key on the HSM is used to sign data and the corresponding public key is used to verify the signature.When the key use is
"enc"(encryption), the private key on the HSM is used to decrypt encrypted data which have been encrypted with the corresponding public key.- Returns:
- The key use.
"sig"(signature) or"enc"(encryption). - See Also:
- RFC 7517 JSON Web Key (JWK), 4.2. "use" (Public Key Use) Parameter
-
setUse
public HskCreateRequest setUse(String use)
Set the use of the key on the HSM.When the key use is
"sig"(signature), the private key on the HSM is used to sign data and the corresponding public key is used to verify the signature.When the key use is
"enc"(encryption), the private key on the HSM is used to decrypt encrypted data which have been encrypted with the corresponding public key.- Parameters:
use- The key use."sig"(signature) or"enc"(encryption).- Returns:
thisobject.- See Also:
- RFC 7517 JSON Web Key (JWK), 4.2. "use" (Public Key Use) Parameter
-
getAlg
public String getAlg()
Get the algorithm of the key on the HSM.When the key use is
"sig", the algorithm represents a signing algorithm such as"ES256".When the key use is
"enc", the algorithm represents an encryption algorithm such as"RSA-OAEP-256".It is rare that HSMs support all the algorithms listed in RFC 7518 JSON Web Algorithms (JWA). When the specified algorithm is not supported by the HSM, the request to the
/api/hsk/createAPI fails.
-
setAlg
public HskCreateRequest setAlg(String alg)
Set the algorithm of the key on the HSM.When the key use is
"sig", the algorithm represents a signing algorithm such as"ES256".When the key use is
"enc", the algorithm represents an encryption algorithm such as"RSA-OAEP-256".It is rare that HSMs support all the algorithms listed in RFC 7518 JSON Web Algorithms (JWA). When the specified algorithm is not supported by the HSM, the request to the
/api/hsk/createAPI fails.- Parameters:
alg- The algorithm.- Returns:
thisobject.- See Also:
- RFC 7517 JSON Web Key (JWK), 4.4. "alg" (Algorithm) Parameter, RFC 7518 JSON Web Algorithms (JWA), 3.1. "alg" (Algorithm) Header Parameter Values for JWS, RFC 7518 JSON Web Algorithms (JWA), 4.1. "alg" (Algorithm) Header Parameter Values for JWE
-
getKid
public String getKid()
Get the key ID for the key on the HSM.Note that the key ID cannot be changed later. Determine the key ID carefully before calling the
/api/hsk/createAPI. If thekidrequest parameter is missing or its value is empty, the API generates a random key ID (base64url-encoded 256-bit random value) for the request.Also note that Authlete does not check duplication of key IDs.
- Returns:
- The key ID.
- See Also:
- RFC 7517 JSON Web Key (JWK), 4.5. "kid" (Key ID) Parameter
-
setKid
public HskCreateRequest setKid(String kid)
Set the key ID for the key on the HSM.Note that the key ID cannot be changed later. Determine the key ID carefully before calling the
/api/hsk/createAPI. If thekidrequest parameter is missing or its value is empty, the API generates a random key ID (base64url-encoded 256-bit random value) for the request.Also note that Authlete does not check duplication of key IDs.
- Parameters:
kid- The key ID.- Returns:
thisobject.- See Also:
- RFC 7517 JSON Web Key (JWK), 4.5. "kid" (Key ID) Parameter
-
getHsmName
public String getHsmName()
Get the name of the HSM.The identifier for the HSM that sits behind the Authlete server. For example,
"google". If thehsmNamerequest parameter is missing or its value is empty, the API uses the default HSM. The value of the default HSM varies depending on the configuration of the Authlete server.- Returns:
- The name of the HSM.
-
setHsmName
public HskCreateRequest setHsmName(String hsmName)
Set the name of the HSM.The identifier for the HSM that sits behind the Authlete server. For example,
"google". If thehsmNamerequest parameter is missing or its value is empty, the API uses the default HSM. The value of the default HSM varies depending on the configuration of the Authlete server.- Parameters:
hsmName- The name of the HSM.- Returns:
thisobject.
-
-