{
// TODO Allow specification of a particular provider
MessageDigest digest = OCSPUtil.createDigestInstance("SHA1", null);
ASN1InputStream aIn = new ASN1InputStream(key.getEncoded());
SubjectPublicKeyInfo info = SubjectPublicKeyInfo.getInstance(aIn.readObject());
digest.update(info.getPublicKeyData().getBytes());
ASN1OctetString keyHash = new DEROctetString(digest.digest());