protected Map < String , List < Object > > extractPersonAttributes ( final X509Certificate certificate ) { val attributes = new LinkedHashMap < String , List < Object > > ( ) ; if ( certificate != null ) { if ( StringUtils . isNotBlank ( certificate . getSigAlgOID ( ) ) ) { attributes . put ( "sigAlgOid" , CollectionUtils . wrapList ( certificate . getSigAlgOID ( ) ) ) ; } val subjectDn = certificate . getSubjectDN ( ) ; if ( subjectDn != null ) { attributes . put ( "subjectDn" , CollectionUtils . wrapList ( subjectDn . getName ( ) ) ) ; } val subjectPrincipal = certificate . getSubjectX500Principal ( ) ; if ( subjectPrincipal != null ) { attributes . put ( "subjectX500Principal" , CollectionUtils . wrapList ( subjectPrincipal . getName ( ) ) ) ; } try { val rfc822Email = getRFC822EmailAddress ( certificate . getSubjectAlternativeNames ( ) ) ; if ( rfc822Email != null ) { attributes . put ( "x509Rfc822Email" , CollectionUtils . wrapList ( rfc822Email ) ) ; } } catch ( final CertificateParsingException e ) { LOGGER . warn ( "Error parsing subject alternative names to get rfc822 email [{}]" , e . getMessage ( ) ) ; } } return attributes ; }
Get additional attributes from the certificate .