+ @Override
+ public Cmpv2CertificationModel certificationRequest(CsrModel csrModel, Cmpv2Server cmpv2Server) throws CmpClientException {
+
+ validate(csrModel, cmpv2Server, httpClient, null, null);
+ final CreateCertRequest certRequest = getIakRvRequest(csrModel, cmpv2Server, null, null, PKIBody.TYPE_CERT_REQ);
+ return executeCmpRequest(csrModel, cmpv2Server, certRequest);
+ }
+
+ private CreateCertRequest getIakRvRequest(
+ CsrModel csrModel,
+ Cmpv2Server server,
+ Date notBefore,
+ Date notAfter,
+ int requestType) {
+
+ final String iak = server.getAuthentication().getIak();
+ final PkiMessageProtection pkiMessageProtection = new PasswordBasedProtection(iak);
+ return getCmpMessageBuilderWithCommonRequestValues(csrModel, server)
+ .with(CreateCertRequest::setNotBefore, notBefore)
+ .with(CreateCertRequest::setNotAfter, notAfter)
+ .with(CreateCertRequest::setSenderKid, server.getAuthentication().getRv())
+ .with(CreateCertRequest::setCmpRequestType, requestType)
+ .with(CreateCertRequest::setProtection, pkiMessageProtection)
+ .build();
+ }
+