Objects of this type can be created from certificates and CRLs using the PrincipalUtil class.
217218219220221222223
return c.getVersion(); } public Principal getIssuerDN() { return new X509Principal(c.getIssuer()); }
266267268269270271272273274275276
static X509Principal convertPrincipal( X500Principal principal) { try { return new X509Principal(principal.getEncoded()); } catch (IOException e) { throw new IllegalArgumentException("cannot convert principal"); }
7071727374757677787980
} public AttributeCertificateHolder(X509Certificate cert) throws CertificateParsingException { X509Principal name; try { name = PrincipalUtil.getIssuerX509Principal(cert); }
212213214215216217218219220221222
if (gn.getTagNo() == GeneralName.directoryName) { try { if (new X509Principal(((ASN1Encodable)gn.getName()) .getEncoded()).equals(subject)) { return true; } }
45464748495051525354555657
{ MessageDigest digest = MessageDigest.getInstance(hashAlgorithm, provider); AlgorithmIdentifier hashAlg = new AlgorithmIdentifier( new DERObjectIdentifier(hashAlgorithm), new DERNull()); X509Principal issuerName = PrincipalUtil.getSubjectX509Principal(issuerCert); digest.update(issuerName.getEncoded()); ASN1OctetString issuerNameHash = new DEROctetString(digest.digest()); PublicKey issuerKey = issuerCert.getPublicKey();
106107108109110111112113114115116
public void setRequestorName( X500Principal requestorName) { try { this.requestorName = new GeneralName(GeneralName.directoryName, new X509Principal(requestorName.getEncoded())); } catch (IOException e) { throw new IllegalArgumentException("cannot encode principal: " + e); }
public void setIssuerDN( X500Principal issuer) { try { tbsGen.setIssuer(new X509Principal(issuer.getEncoded())); } catch (IOException e) { throw new IllegalArgumentException("can't process principal: " + e); }
7980818283848586878889
117118119120121122123124125126127
public void setSubjectDN( X500Principal subject) { try { tbsGen.setSubject(new X509Principal(subject.getEncoded())); } catch (IOException e) { throw new IllegalArgumentException("can't process principal: " + e); }
2829303132333435363738
public RespID( X500Principal name) { try { this.id = new ResponderID(new X509Principal(name.getEncoded())); } catch (IOException e) { throw new IllegalArgumentException("can't decode name."); }