diff options
author | 2020-03-10 13:34:56 +0000 | |
---|---|---|
committer | 2020-03-10 13:34:56 +0000 | |
commit | 50ec01532a2c3816d964bf6b1b870968536a6fd7 (patch) | |
tree | 2288472d7628a55110f0c893e195e139e21c3f75 /certService/src/main/java/org/onap | |
parent | a7195b91800a49f749c806d060fadb167d3f1795 (diff) | |
parent | 8074f15490033ad124212a2d876466ccc4e56dad (diff) |
Merge "Fixed sonar issues in RDN class"
Diffstat (limited to 'certService/src/main/java/org/onap')
-rw-r--r-- | certService/src/main/java/org/onap/aaf/certservice/cmpv2client/external/CSRMeta.java | 2 | ||||
-rw-r--r-- | certService/src/main/java/org/onap/aaf/certservice/cmpv2client/external/RDN.java | 33 |
2 files changed, 16 insertions, 19 deletions
diff --git a/certService/src/main/java/org/onap/aaf/certservice/cmpv2client/external/CSRMeta.java b/certService/src/main/java/org/onap/aaf/certservice/cmpv2client/external/CSRMeta.java index de11b5bb..aa9748f9 100644 --- a/certService/src/main/java/org/onap/aaf/certservice/cmpv2client/external/CSRMeta.java +++ b/certService/src/main/java/org/onap/aaf/certservice/cmpv2client/external/CSRMeta.java @@ -67,7 +67,7 @@ public class CSRMeta { } } for (RDN rdn : rdns) { - xnb.addRDN(rdn.aoi, rdn.value); + xnb.addRDN(rdn.getAoi(), rdn.getValue()); } name = xnb.build(); } diff --git a/certService/src/main/java/org/onap/aaf/certservice/cmpv2client/external/RDN.java b/certService/src/main/java/org/onap/aaf/certservice/cmpv2client/external/RDN.java index 69445b2e..0e1ab25f 100644 --- a/certService/src/main/java/org/onap/aaf/certservice/cmpv2client/external/RDN.java +++ b/certService/src/main/java/org/onap/aaf/certservice/cmpv2client/external/RDN.java @@ -1,4 +1,4 @@ -/** +/* * ============LICENSE_START==================================================== * org.onap.aaf * =========================================================================== @@ -30,54 +30,51 @@ import org.bouncycastle.cert.CertException; public class RDN { - public String tag; - public String value; - public ASN1ObjectIdentifier aoi; + private String tag; + private String value; + private ASN1ObjectIdentifier aoi; + + public String getValue() { + return value; + } + + public ASN1ObjectIdentifier getAoi() { + return aoi; + } public RDN(final String tagValue) throws CertException { String[] tv = Split.splitTrim('=', tagValue); - switch (tv[0]) { + switch (tv[0].toLowerCase()) { case "cn": - case "CN": aoi = BCStyle.CN; break; case "c": - case "C": aoi = BCStyle.C; break; case "st": - case "ST": aoi = BCStyle.ST; break; case "l": - case "L": aoi = BCStyle.L; break; case "o": - case "O": aoi = BCStyle.O; break; case "ou": - case "OU": aoi = BCStyle.OU; break; case "dc": - case "DC": aoi = BCStyle.DC; break; case "gn": - case "GN": aoi = BCStyle.GIVENNAME; break; case "sn": - case "SN": aoi = BCStyle.SN; - break; // surname + break; case "email": - case "EMAIL": - case "E": + case "e": case "emailaddress": - case "EMAILADDRESS": aoi = BCStyle.EmailAddress; break; // should be SAN extension case "initials": |