diff options
author | 2020-03-04 16:03:36 +0000 | |
---|---|---|
committer | 2020-03-04 16:03:36 +0000 | |
commit | 8f26d1f4274f18bd9502386700919933045e2316 (patch) | |
tree | d4272a9d867ed67aedc72bd79efaf33c3642dac6 /certService/src/main/java/org/onap/aaf/certservice/cmpv2client/impl/CmpUtil.java | |
parent | ddc9e99c372c32d9c62014ac1751f5840c734410 (diff) | |
parent | 9b682503a32af10dd6335c897e73e0e63f688210 (diff) |
Merge "Authenticate response from CMP server"
Diffstat (limited to 'certService/src/main/java/org/onap/aaf/certservice/cmpv2client/impl/CmpUtil.java')
-rw-r--r-- | certService/src/main/java/org/onap/aaf/certservice/cmpv2client/impl/CmpUtil.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/certService/src/main/java/org/onap/aaf/certservice/cmpv2client/impl/CmpUtil.java b/certService/src/main/java/org/onap/aaf/certservice/cmpv2client/impl/CmpUtil.java index 86935135..1bda4ac1 100644 --- a/certService/src/main/java/org/onap/aaf/certservice/cmpv2client/impl/CmpUtil.java +++ b/certService/src/main/java/org/onap/aaf/certservice/cmpv2client/impl/CmpUtil.java @@ -31,6 +31,8 @@ import org.bouncycastle.asn1.ASN1GeneralizedTime; import org.bouncycastle.asn1.DEROctetString; import org.bouncycastle.asn1.DEROutputStream; import org.bouncycastle.asn1.DERSequence; +import org.bouncycastle.asn1.cmp.CMPObjectIdentifiers; +import org.bouncycastle.asn1.cmp.InfoTypeAndValue; import org.bouncycastle.asn1.cmp.PKIBody; import org.bouncycastle.asn1.cmp.PKIHeader; import org.bouncycastle.asn1.cmp.PKIHeaderBuilder; @@ -129,7 +131,7 @@ public final class CmpUtil { * @return PKIHeaderBuilder */ static PKIHeader generatePkiHeader( - X500Name subjectDn, X500Name issuerDn, AlgorithmIdentifier protectionAlg) { + X500Name subjectDn, X500Name issuerDn, AlgorithmIdentifier protectionAlg, String senderKid) { LOGGER.info("Generating a Pki Header Builder"); PKIHeaderBuilder pkiHeaderBuilder = new PKIHeaderBuilder( @@ -139,6 +141,8 @@ public final class CmpUtil { pkiHeaderBuilder.setSenderNonce(new DEROctetString(createRandomBytes())); pkiHeaderBuilder.setTransactionID(new DEROctetString(createRandomBytes())); pkiHeaderBuilder.setProtectionAlg(protectionAlg); + pkiHeaderBuilder.setGeneralInfo(new InfoTypeAndValue(CMPObjectIdentifiers.it_implicitConfirm)); + pkiHeaderBuilder.setSenderKID(new DEROctetString(senderKid.getBytes())); return pkiHeaderBuilder.build(); } |