List of usage examples for org.bouncycastle.asn1.isismtt.x509 ProcurationSyntax getTypeOfSubstitution
public DirectoryString getTypeOfSubstitution()
From source file:net.sf.keystore_explorer.crypto.x509.X509Ext.java
License:Open Source License
private String getProcurationStringValue(byte[] octets) throws IOException { // @formatter:off /*/*from w w w .j a v a2 s . c o m*/ ProcurationSyntax ::= SEQUENCE { country [1] EXPLICIT PrintableString(SIZE(2)) OPTIONAL, typeOfSubstitution [2] EXPLICIT DirectoryString(SIZE(1..128)) OPTIONAL, signingFor [3] EXPLICIT SigningFor } SigningFor ::= CHOICE { thirdPerson GeneralName, certRef IssuerSerial } */ // @formatter:on StringBuilder sb = new StringBuilder(); ProcurationSyntax procurationSyntax = ProcurationSyntax.getInstance(octets); String country = procurationSyntax.getCountry(); DirectoryString typeOfSubstitution = procurationSyntax.getTypeOfSubstitution(); GeneralName thirdPerson = procurationSyntax.getThirdPerson(); IssuerSerial certRef = procurationSyntax.getCertRef(); if (country != null) { sb.append(MessageFormat.format(res.getString("Procuration.Country"), country)); sb.append(NEWLINE); } if (typeOfSubstitution != null) { sb.append(MessageFormat.format(res.getString("Procuration.TypeOfSubstitution"), typeOfSubstitution.toString())); sb.append(NEWLINE); } if (thirdPerson != null) { sb.append(MessageFormat.format(res.getString("Procuration.ThirdPerson"), GeneralNameUtil.toString(thirdPerson))); sb.append(NEWLINE); } if (certRef != null) { sb.append(res.getString("Procuration.CertRef")); sb.append(NEWLINE); sb.append(INDENT); sb.append(res.getString("Procuration.CertRef.Issuer")); for (GeneralName generalName : certRef.getIssuer().getNames()) { sb.append(INDENT); sb.append(INDENT); sb.append(GeneralNameUtil.toString(generalName)); sb.append(NEWLINE); } sb.append(NEWLINE); sb.append(INDENT); sb.append(MessageFormat.format(res.getString("Procuration.CertRef.SN"), HexUtil.getHexString(certRef.getSerial().getValue()))); sb.append(NEWLINE); } return sb.toString(); }