protected String getCertIdentifier ( X509CertifiedPublicKey publicKey ) throws IOException { byte [ ] keyId = publicKey . getSubjectKeyIdentifier ( ) ; if ( keyId != null ) { return this . hex . encode ( keyId ) ; } return publicKey . getSerialNumber ( ) . toString ( ) + ", " + publicKey . getIssuer ( ) . getName ( ) ; }
Return a unique identifier appropriate for a file name . If the certificate as a subject key identifier the result is this encoded identifier . Else use the concatenation of the certificate serial number and the issuer name .