diff options
author | Michal Banka <michal.banka@nokia.com> | 2020-02-28 08:55:21 +0100 |
---|---|---|
committer | Michal Banka <michal.banka@nokia.com> | 2020-03-10 14:02:55 +0100 |
commit | 8074f15490033ad124212a2d876466ccc4e56dad (patch) | |
tree | 227f28f6cf2d2f9c63baddb1c9b18ee5d43b0e94 /certService | |
parent | 2707256575d4c697c43340fe6f26fdd4f9000e13 (diff) |
Fixed sonar issues in RDN class
Signed-off-by: Michal Banka <michal.banka@nokia.com>
Change-Id: Ib480aac3ad754f044f5dcdc685a10e12c89bd467
Issue-ID: AAF-997
Diffstat (limited to 'certService')
-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": |