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
diff options
context:
space:
mode:
authorDavid Hook <dgh@cryptoworkshop.com>2013-10-06 03:12:01 +0400
committerDavid Hook <dgh@cryptoworkshop.com>2013-10-06 03:12:01 +0400
commit8561f23f45f26d5c77aa31f2366536535b9dccd0 (patch)
treee39d10d552824c9026c282fe587733817408fb2e /core/src/main/java/org/bouncycastle/asn1
parent7097de634c1146db945ac4489fe4378df29633c9 (diff)
added caching of hashCode values.
added hashCode check to X509CRLObject
Diffstat (limited to 'core/src/main/java/org/bouncycastle/asn1')
-rw-r--r--core/src/main/java/org/bouncycastle/asn1/x509/CertificateList.java17
1 files changed, 17 insertions, 0 deletions
diff --git a/core/src/main/java/org/bouncycastle/asn1/x509/CertificateList.java b/core/src/main/java/org/bouncycastle/asn1/x509/CertificateList.java
index 91a37ade..61d7d4a5 100644
--- a/core/src/main/java/org/bouncycastle/asn1/x509/CertificateList.java
+++ b/core/src/main/java/org/bouncycastle/asn1/x509/CertificateList.java
@@ -31,6 +31,8 @@ public class CertificateList
TBSCertList tbsCertList;
AlgorithmIdentifier sigAlgId;
DERBitString sig;
+ boolean isHashCodeSet = false;
+ int hashCodeValue;
public static CertificateList getInstance(
ASN1TaggedObject obj,
@@ -54,6 +56,10 @@ public class CertificateList
return null;
}
+ /**
+ * @deprecated use getInstance() method.
+ * @param seq
+ */
public CertificateList(
ASN1Sequence seq)
{
@@ -124,4 +130,15 @@ public class CertificateList
return new DERSequence(v);
}
+
+ public int hashCode()
+ {
+ if (!isHashCodeSet)
+ {
+ hashCodeValue = super.hashCode();
+ isHashCodeSet = true;
+ }
+
+ return hashCodeValue;
+ }
}