public String certToString ( ) { StringBuilder sb = new StringBuilder ( ) ; X509CertImpl x509Cert = null ; try { x509Cert = X509CertImpl . toImpl ( cert ) ; } catch ( CertificateException ce ) { if ( debug != null ) { debug . println ( "Vertex.certToString() unexpected exception" ) ; ce . printStackTrace ( ) ; } return sb . toString ( ) ; } sb . append ( "Issuer: " ) . append ( x509Cert . getIssuerX500Principal ( ) ) . append ( "\n" ) ; sb . append ( "Subject: " ) . append ( x509Cert . getSubjectX500Principal ( ) ) . append ( "\n" ) ; sb . append ( "SerialNum: " ) . append ( x509Cert . getSerialNumber ( ) . toString ( 16 ) ) . append ( "\n" ) ; sb . append ( "Expires: " ) . append ( x509Cert . getNotAfter ( ) . toString ( ) ) . append ( "\n" ) ; boolean [ ] iUID = x509Cert . getIssuerUniqueID ( ) ; if ( iUID != null ) { sb . append ( "IssuerUID: " ) ; for ( boolean b : iUID ) { sb . append ( b ? 1 : 0 ) ; } sb . append ( "\n" ) ; } boolean [ ] sUID = x509Cert . getSubjectUniqueID ( ) ; if ( sUID != null ) { sb . append ( "SubjectUID: " ) ; for ( boolean b : sUID ) { sb . append ( b ? 1 : 0 ) ; } sb . append ( "\n" ) ; } try { SubjectKeyIdentifierExtension sKeyID = x509Cert . getSubjectKeyIdentifierExtension ( ) ; if ( sKeyID != null ) { KeyIdentifier keyID = sKeyID . get ( SubjectKeyIdentifierExtension . KEY_ID ) ; sb . append ( "SubjKeyID: " ) . append ( keyID . toString ( ) ) ; } AuthorityKeyIdentifierExtension aKeyID = x509Cert . getAuthorityKeyIdentifierExtension ( ) ; if ( aKeyID != null ) { KeyIdentifier keyID = ( KeyIdentifier ) aKeyID . get ( AuthorityKeyIdentifierExtension . KEY_ID ) ; sb . append ( "AuthKeyID: " ) . append ( keyID . toString ( ) ) ; } } catch ( IOException e ) { if ( debug != null ) { debug . println ( "Vertex.certToString() unexpected exception" ) ; e . printStackTrace ( ) ; } } return sb . toString ( ) ; }
Return string representation of this vertex s certificate information .