Class KeymanagerController
java.lang.Object
io.mosip.kernel.keymanagerservice.controller.KeymanagerController
This class provides controller methods for Key manager.
- Since:
- 1.0.0
- Author:
- Dharmesh Khandelwal, Urvil Joshi
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionio.mosip.kernel.core.http.ResponseWrapper<KeyPairGenerateResponseDto> generateCSR(@Valid io.mosip.kernel.core.http.RequestWrapper<CSRGenerateRequestDto> csrGenRequestDto) Request to Generate CSR for the provided APP ID invalid input: '&' REF ID along with other certificate params.io.mosip.kernel.core.http.ResponseWrapper<KeyPairGenerateResponseDto> generateECSignKey(String objectType, @Valid io.mosip.kernel.core.http.RequestWrapper<KeyPairGenerateRequestDto> ecKeyPairGenRequestDto) Request to generate component Signature ECC Key pair invalid input: '&' Certificate for the Provided APP ID invalid input: '&' REF ID.io.mosip.kernel.core.http.ResponseWrapper<KeyPairGenerateResponseDto> generateMasterKey(String objectType, @Valid io.mosip.kernel.core.http.RequestWrapper<KeyPairGenerateRequestDto> keyPairGenRequestDto) Generate Master Key for the provided APP ID.io.mosip.kernel.core.http.ResponseWrapper<SymmetricKeyGenerateResponseDto> generateSymmetricKey(@Valid io.mosip.kernel.core.http.RequestWrapper<SymmetricKeyGenerateRequestDto> symGenRequestDto) Request to Generate Symmetric key for the provided APP ID invalid input: '&' REF ID.io.mosip.kernel.core.http.ResponseWrapper<AllCertificatesDataResponseDto> getAllCertificates(String applicationId, Optional<String> referenceId) Request to get all the Certificates for the Provided APP ID invalid input: '&' REF ID.io.mosip.kernel.core.http.ResponseWrapper<KeyPairGenerateResponseDto> getCertificate(String applicationId, Optional<String> referenceId) Request to get Certificate for the Provided APP ID invalid input: '&' REF ID.io.mosip.kernel.core.http.ResponseWrapper<RevokeKeyResponseDto> revokeKey(@Valid io.mosip.kernel.core.http.RequestWrapper<RevokeKeyRequestDto> revokeKeyRequestDto) Request to Revoke Base Key for the provided APP ID invalid input: '&' REF ID.io.mosip.kernel.core.http.ResponseWrapper<UploadCertificateResponseDto> uploadCertificate(@Valid io.mosip.kernel.core.http.RequestWrapper<UploadCertificateRequestDto> uploadCertRequestDto) Update signed certificate for the provided APP ID invalid input: '&' REF ID.io.mosip.kernel.core.http.ResponseWrapper<UploadCertificateResponseDto> uploadOtherDomainCertificate(@Valid io.mosip.kernel.core.http.RequestWrapper<UploadCertificateRequestDto> uploadCertRequestDto) Update signed certificate for the provided APP ID invalid input: '&' REF ID for other domains.
-
Constructor Details
-
KeymanagerController
public KeymanagerController()
-
-
Method Details
-
generateMasterKey
@PreAuthorize("hasAnyRole(@KeyManagerAuthRoles.getPostgeneratemasterkeyobjecttype())") @ResponseFilter @PostMapping("/generateMasterKey/{objectType}") public io.mosip.kernel.core.http.ResponseWrapper<KeyPairGenerateResponseDto> generateMasterKey(@PathVariable("objectType") String objectType, @RequestBody @Valid @Valid io.mosip.kernel.core.http.RequestWrapper<KeyPairGenerateRequestDto> keyPairGenRequestDto) Generate Master Key for the provided APP ID.- Parameters:
objectType- response Object Type. Support types are Certificate/CSR. Path Parameter.keyPairGenRequestDto-KeyPairGenerateRequestDtorequest- Returns:
KeyPairGenerateResponseDtoinstance
-
getCertificate
@PreAuthorize("hasAnyRole(@KeyManagerAuthRoles.getGetgetcertificate())") @ResponseFilter @GetMapping("/getCertificate") public io.mosip.kernel.core.http.ResponseWrapper<KeyPairGenerateResponseDto> getCertificate(@RequestParam("applicationId") String applicationId, @RequestParam("referenceId") Optional<String> referenceId) Request to get Certificate for the Provided APP ID invalid input: '&' REF ID.- Parameters:
applicationId- Application id of the application requesting CertificatereferenceId- Reference id of the application requesting Certificate. Blank in case of Master Key.- Returns:
KeyPairGenerateResponseDtoinstance
-
generateCSR
@PreAuthorize("hasAnyRole(@KeyManagerAuthRoles.getPostgeneratecsr())") @ResponseFilter @PostMapping("/generateCSR") public io.mosip.kernel.core.http.ResponseWrapper<KeyPairGenerateResponseDto> generateCSR(@RequestBody @Valid @Valid io.mosip.kernel.core.http.RequestWrapper<CSRGenerateRequestDto> csrGenRequestDto) Request to Generate CSR for the provided APP ID invalid input: '&' REF ID along with other certificate params.- Parameters:
csrGenRequestDto-CSRGenerateRequestDtorequest- Returns:
KeyPairGenerateResponseDtoinstance
-
uploadCertificate
@ResponseFilter @PreAuthorize("hasAnyRole(@KeyManagerAuthRoles.getPostuploadcertificate())") @PostMapping("/uploadCertificate") public io.mosip.kernel.core.http.ResponseWrapper<UploadCertificateResponseDto> uploadCertificate(@RequestBody @Valid @Valid io.mosip.kernel.core.http.RequestWrapper<UploadCertificateRequestDto> uploadCertRequestDto) Update signed certificate for the provided APP ID invalid input: '&' REF ID.- Parameters:
uploadCertRequestDto-UploadCertificateRequestDtorequest- Returns:
UploadCertificateResponseDtoinstance
-
uploadOtherDomainCertificate
@PreAuthorize("hasAnyRole(@KeyManagerAuthRoles.getPostuploadotherdomaincertificate())") @ResponseFilter @PostMapping("/uploadOtherDomainCertificate") public io.mosip.kernel.core.http.ResponseWrapper<UploadCertificateResponseDto> uploadOtherDomainCertificate(@RequestBody @Valid @Valid io.mosip.kernel.core.http.RequestWrapper<UploadCertificateRequestDto> uploadCertRequestDto) Update signed certificate for the provided APP ID invalid input: '&' REF ID for other domains.- Parameters:
uploadCertRequestDto-UploadCertificateRequestDtorequest- Returns:
UploadCertificateResponseDtoinstance
-
generateSymmetricKey
@PreAuthorize("hasAnyRole(@KeyManagerAuthRoles.getPostgeneratesymmetrickey())") @ResponseFilter @PostMapping("/generateSymmetricKey") public io.mosip.kernel.core.http.ResponseWrapper<SymmetricKeyGenerateResponseDto> generateSymmetricKey(@RequestBody @Valid @Valid io.mosip.kernel.core.http.RequestWrapper<SymmetricKeyGenerateRequestDto> symGenRequestDto) Request to Generate Symmetric key for the provided APP ID invalid input: '&' REF ID.- Parameters:
symGenRequestDto-SymmetricKeyGenerateRequestDtorequest- Returns:
SymmetricKeyGenerateResponseDtoinstance
-
revokeKey
@PreAuthorize("hasAnyRole(@KeyManagerAuthRoles.getPutrevokekey())") @ResponseFilter @PutMapping("/revokeKey") public io.mosip.kernel.core.http.ResponseWrapper<RevokeKeyResponseDto> revokeKey(@RequestBody @Valid @Valid io.mosip.kernel.core.http.RequestWrapper<RevokeKeyRequestDto> revokeKeyRequestDto) Request to Revoke Base Key for the provided APP ID invalid input: '&' REF ID.- Parameters:
revokeKeyRequestDto-RevokeKeyRequestDtorequest- Returns:
RevokeKeyResponseDtoinstance
-
getAllCertificates
@PreAuthorize("hasAnyRole(@KeyManagerAuthRoles.getGetgetcertificate())") @ResponseFilter @GetMapping("/getAllCertificates") public io.mosip.kernel.core.http.ResponseWrapper<AllCertificatesDataResponseDto> getAllCertificates(@RequestParam("applicationId") String applicationId, @RequestParam("referenceId") Optional<String> referenceId) Request to get all the Certificates for the Provided APP ID invalid input: '&' REF ID.- Parameters:
applicationId- Application id of the application requesting CertificatereferenceId- Reference id of the application requesting Certificate. Blank in case of Master Key.- Returns:
KeyPairGenerateResponseDtoinstance
-
generateECSignKey
@PreAuthorize("hasAnyRole(@KeyManagerAuthRoles.getGetgetcertificate())") @ResponseFilter @PostMapping("/generateECSignKey/{objectType}") public io.mosip.kernel.core.http.ResponseWrapper<KeyPairGenerateResponseDto> generateECSignKey(@PathVariable("objectType") String objectType, @RequestBody @Valid @Valid io.mosip.kernel.core.http.RequestWrapper<KeyPairGenerateRequestDto> ecKeyPairGenRequestDto) Request to generate component Signature ECC Key pair invalid input: '&' Certificate for the Provided APP ID invalid input: '&' REF ID. Supported Curve(s) SECP256K1, SECP256R1 and ED25519.- Parameters:
objectType- response Object Type. Support types are Certificate/CSR.keyPairGenRequestDto-KeyPairGenerateRequestDtorequest- Returns:
KeyPairGenerateResponseDtoinstance
-