final X509EncodedKeySpec xspec = new X509EncodedKeySpec(new DERBitString(subjectPKInfo).getBytes());
final AlgorithmIdentifier keyAlg = subjectPKInfo.getAlgorithmId ();
return KeyFactory.getInstance(keyAlg.getObjectId().getId (), provider).generatePublic(xspec);
} catch (java.security.spec.InvalidKeySpecException e) {
final InvalidKeyException newe = new InvalidKeyException("Error decoding public key.");
newe.initCause(e);
throw newe;
}
}
/** force a password, i.e. ignore the password in the request