Class KeymanagerController

java.lang.Object
io.mosip.kernel.keymanagerservice.controller.KeymanagerController

@CrossOrigin @RestController public class KeymanagerController extends Object
This class provides controller methods for Key manager.
Since:
1.0.0
Author:
Dharmesh Khandelwal, Urvil Joshi
  • 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 - KeyPairGenerateRequestDto request
      Returns:
      KeyPairGenerateResponseDto instance
    • 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 Certificate
      referenceId - Reference id of the application requesting Certificate. Blank in case of Master Key.
      Returns:
      KeyPairGenerateResponseDto instance
    • 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 - CSRGenerateRequestDto request
      Returns:
      KeyPairGenerateResponseDto instance
    • 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 - UploadCertificateRequestDto request
      Returns:
      UploadCertificateResponseDto instance
    • 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 - UploadCertificateRequestDto request
      Returns:
      UploadCertificateResponseDto instance
    • 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 - SymmetricKeyGenerateRequestDto request
      Returns:
      SymmetricKeyGenerateResponseDto instance
    • 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 - RevokeKeyRequestDto request
      Returns:
      RevokeKeyResponseDto instance
    • 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 Certificate
      referenceId - Reference id of the application requesting Certificate. Blank in case of Master Key.
      Returns:
      KeyPairGenerateResponseDto instance
    • 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 - KeyPairGenerateRequestDto request
      Returns:
      KeyPairGenerateResponseDto instance