X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=cadi%2Fcore%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Faaf%2Fcadi%2Fprincipal%2FX509Principal.java;h=0348cd1f5ce651bad01f11533e443e9605bb3d42;hb=7e966914050e66219689001ff4ab601a49eef0ac;hp=1cd114a033468c1da3447e0c87bfbca396a693cf;hpb=ead32f193586e39b59bb366bddf70e665173a52d;p=aaf%2Fauthz.git diff --git a/cadi/core/src/main/java/org/onap/aaf/cadi/principal/X509Principal.java b/cadi/core/src/main/java/org/onap/aaf/cadi/principal/X509Principal.java index 1cd114a0..0348cd1f 100644 --- a/cadi/core/src/main/java/org/onap/aaf/cadi/principal/X509Principal.java +++ b/cadi/core/src/main/java/org/onap/aaf/cadi/principal/X509Principal.java @@ -55,17 +55,17 @@ public class X509Principal extends BearerPrincipal implements GetCred { String _name = null; String subj = cert.getSubjectDN().getName(); int cn = subj.indexOf("OU="); - if(cn>=0) { + if (cn>=0) { cn+=3; int space = subj.indexOf(',',cn); - if(space>=0) { + if (space>=0) { String id = subj.substring(cn, space); - if(pattern.matcher(id).matches()) { + if (pattern.matcher(id).matches()) { _name = id; } } } - if(_name==null) { + if (_name==null) { throw new IOException("X509 does not have Identity as CN"); } name = _name; @@ -74,7 +74,7 @@ public class X509Principal extends BearerPrincipal implements GetCred { public String getAsHeader() throws IOException { try { - if(content==null) { + if (content==null) { content=cert.getEncoded(); } } catch (CertificateEncodingException e) {