use of sun.security.util.HexDumpEncoder in project Bytecoder by mirkosertic.
the class X509CRLEntryImpl method toString.
/**
* Returns a printable string of this revoked certificate.
*
* @return value of this revoked certificate in a printable form.
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(serialNumber).append(" On: ").append(revocationDate);
if (certIssuer != null) {
sb.append("\n Certificate issuer: ").append(certIssuer);
}
if (extensions != null) {
Collection<Extension> allEntryExts = extensions.getAllExtensions();
Extension[] exts = allEntryExts.toArray(new Extension[0]);
sb.append("\n CRL Entry Extensions: ").append(exts.length);
for (int i = 0; i < exts.length; i++) {
sb.append("\n [").append(i + 1).append("]: ");
Extension ext = exts[i];
try {
if (OIDMap.getClass(ext.getExtensionId()) == null) {
sb.append(ext);
byte[] extValue = ext.getExtensionValue();
if (extValue != null) {
DerOutputStream out = new DerOutputStream();
out.putOctetString(extValue);
extValue = out.toByteArray();
HexDumpEncoder enc = new HexDumpEncoder();
sb.append("Extension unknown: ").append("DER encoded OCTET string =\n").append(enc.encodeBuffer(extValue)).append('\n');
}
} else {
// sub-class exists
sb.append(ext);
}
} catch (Exception e) {
sb.append(", Error parsing this extension");
}
}
}
sb.append('\n');
return sb.toString();
}
use of sun.security.util.HexDumpEncoder in project Bytecoder by mirkosertic.
the class KeyIdentifier method toString.
/**
* Returns a printable representation of the KeyUsage.
*/
public String toString() {
String s = "KeyIdentifier [\n";
HexDumpEncoder encoder = new HexDumpEncoder();
s += encoder.encodeBuffer(octetString);
s += "]\n";
return (s);
}
use of sun.security.util.HexDumpEncoder in project Bytecoder by mirkosertic.
the class PolicyQualifierInfo method toString.
/**
* Return a printable representation of this
* {@code PolicyQualifierInfo}.
*
* @return a {@code String} describing the contents of this
* {@code PolicyQualifierInfo}
*/
public String toString() {
if (pqiString != null)
return pqiString;
HexDumpEncoder enc = new HexDumpEncoder();
StringBuilder sb = new StringBuilder();
sb.append("PolicyQualifierInfo: [\n");
sb.append(" qualifierID: " + mId + "\n");
sb.append(" qualifier: " + (mData == null ? "null" : enc.encodeBuffer(mData)) + "\n");
sb.append("]");
pqiString = sb.toString();
return pqiString;
}
use of sun.security.util.HexDumpEncoder in project Bytecoder by mirkosertic.
the class X509CertSelector method toString.
/**
* Return a printable representation of the {@code CertSelector}.
*
* @return a {@code String} describing the contents of the
* {@code CertSelector}
*/
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("X509CertSelector: [\n");
if (x509Cert != null) {
sb.append(" Certificate: " + x509Cert.toString() + "\n");
}
if (serialNumber != null) {
sb.append(" Serial Number: " + serialNumber.toString() + "\n");
}
if (issuer != null) {
sb.append(" Issuer: " + getIssuerAsString() + "\n");
}
if (subject != null) {
sb.append(" Subject: " + getSubjectAsString() + "\n");
}
sb.append(" matchAllSubjectAltNames flag: " + String.valueOf(matchAllSubjectAltNames) + "\n");
if (subjectAlternativeNames != null) {
sb.append(" SubjectAlternativeNames:\n");
Iterator<List<?>> i = subjectAlternativeNames.iterator();
while (i.hasNext()) {
List<?> list = i.next();
sb.append(" type " + list.get(0) + ", name " + list.get(1) + "\n");
}
}
if (subjectKeyID != null) {
HexDumpEncoder enc = new HexDumpEncoder();
sb.append(" Subject Key Identifier: " + enc.encodeBuffer(subjectKeyID) + "\n");
}
if (authorityKeyID != null) {
HexDumpEncoder enc = new HexDumpEncoder();
sb.append(" Authority Key Identifier: " + enc.encodeBuffer(authorityKeyID) + "\n");
}
if (certificateValid != null) {
sb.append(" Certificate Valid: " + certificateValid.toString() + "\n");
}
if (privateKeyValid != null) {
sb.append(" Private Key Valid: " + privateKeyValid.toString() + "\n");
}
if (subjectPublicKeyAlgID != null) {
sb.append(" Subject Public Key AlgID: " + subjectPublicKeyAlgID.toString() + "\n");
}
if (subjectPublicKey != null) {
sb.append(" Subject Public Key: " + subjectPublicKey.toString() + "\n");
}
if (keyUsage != null) {
sb.append(" Key Usage: " + keyUsageToString(keyUsage) + "\n");
}
if (keyPurposeSet != null) {
sb.append(" Extended Key Usage: " + keyPurposeSet.toString() + "\n");
}
if (policy != null) {
sb.append(" Policy: " + policy.toString() + "\n");
}
if (pathToGeneralNames != null) {
sb.append(" Path to names:\n");
Iterator<GeneralNameInterface> i = pathToGeneralNames.iterator();
while (i.hasNext()) {
sb.append(" " + i.next() + "\n");
}
}
sb.append("]");
return sb.toString();
}
use of sun.security.util.HexDumpEncoder in project Bytecoder by mirkosertic.
the class BlockCipherParamsCore method toString.
/*
* Returns a formatted string describing the parameters.
*/
public String toString() {
String LINE_SEP = System.getProperty("line.separator");
String ivString = LINE_SEP + " iv:" + LINE_SEP + "[";
HexDumpEncoder encoder = new HexDumpEncoder();
ivString += encoder.encodeBuffer(this.iv);
ivString += "]" + LINE_SEP;
return ivString;
}
Aggregations