Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/quite/humla-spongycastle.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/prov
diff options
context:
space:
mode:
authorDavid Hook <dgh@cryptoworkshop.com>2014-06-28 06:43:54 +0400
committerDavid Hook <dgh@cryptoworkshop.com>2014-06-28 06:43:54 +0400
commit1f7ddbb95eccb83647b8158adb5026e68f9ae765 (patch)
tree077f39876510aa59880c93707d1091c1c82ce54d /prov
parent4acf6cc77b65126ea08bfd46ccb1eb771a9dfbd5 (diff)
update
Diffstat (limited to 'prov')
-rw-r--r--prov/src/main/jdk1.3/org/bouncycastle/jcajce/provider/keystore/pkcs12/PKCS12KeyStoreSpi.java13
1 files changed, 12 insertions, 1 deletions
diff --git a/prov/src/main/jdk1.3/org/bouncycastle/jcajce/provider/keystore/pkcs12/PKCS12KeyStoreSpi.java b/prov/src/main/jdk1.3/org/bouncycastle/jcajce/provider/keystore/pkcs12/PKCS12KeyStoreSpi.java
index 314bcbf4..8559a5b6 100644
--- a/prov/src/main/jdk1.3/org/bouncycastle/jcajce/provider/keystore/pkcs12/PKCS12KeyStoreSpi.java
+++ b/prov/src/main/jdk1.3/org/bouncycastle/jcajce/provider/keystore/pkcs12/PKCS12KeyStoreSpi.java
@@ -190,7 +190,7 @@ public class PKCS12KeyStoreSpi
{
SubjectPublicKeyInfo info = SubjectPublicKeyInfo.getInstance(pubKey.getEncoded());
- return new SubjectKeyIdentifier(info);
+ return new SubjectKeyIdentifier(getDigest(info));
}
catch (Exception e)
{
@@ -198,6 +198,17 @@ public class PKCS12KeyStoreSpi
}
}
+ private static byte[] getDigest(SubjectPublicKeyInfo spki)
+ {
+ Digest digest = new SHA1Digest();
+ byte[] resBuf = new byte[digest.getDigestSize()];
+
+ byte[] bytes = spki.getPublicKeyData().getBytes();
+ digest.update(bytes, 0, bytes.length);
+ digest.doFinal(resBuf, 0);
+ return resBuf;
+ }
+
public void setRandom(
SecureRandom rand)
{