@Override public ByteString normalizeAttributeValue(final Schema schema,final ByteSequence value) throws DecodeException {
  final BigInteger serialNumber;
  final String dnstring;
  try {
    CertificateFactory certFactory=CertificateFactory.getInstance("X.509");
    InputStream inputStream=new ByteArrayInputStream(value.toByteArray());
    X509Certificate certValue=(X509Certificate)certFactory.generateCertificate(inputStream);
    serialNumber=certValue.getSerialNumber();
    X500Principal issuer=certValue.getIssuerX500Principal();
    dnstring=issuer.getName(X500Principal.RFC2253);
  }
 catch (  CertificateException ce) {
    final LocalizableMessage message=ERR_MR_CERTIFICATE_MATCH_PARSE_ERROR.get(ce.getMessage());
    logger.trace(message);
    return value.toByteString();
  }
  final ByteString certificateIssuer=normalizeDN(schema,dnstring);
  return createEncodedValue(serialNumber,certificateIssuer);
}

@ Override public ByteString normalizeAttributeValue ( final Schema schema , final ByteSequence value ) throws DecodeException { final BigInteger serialNumber ; final String dnstring ; try { CertificateFactory certFactory = CertificateFactory . getInstance ( "X.509" ) ; InputStream inputStream = new ByteArrayInputStream ( value . toByteArray ( ) ) ; X509Certificate certValue = ( X509Certificate ) certFactory . generateCertificate ( inputStream ) ; serialNumber = certValue . getSerialNumber ( ) ; X500Principal issuer = certValue . getIssuerX500Principal ( ) ; dnstring = issuer . getName ( X500Principal . RFC2253 ) ; } catch ( CertificateException ce ) { final LocalizableMessage message = ERR_MR_CERTIFICATE_MATCH_PARSE_ERROR . get ( ce . getMessage ( ) ) ; logger . trace ( message ) ; return value . toByteString ( ) ; } final ByteString certificateIssuer = normalizeDN ( schema , dnstring ) ; return createEncodedValue ( serialNumber , certificateIssuer ) ; }
retrieves the normalized form of the provided value , which is best suited for efficiently performing matching operations on that value .
