summary refs log tree commit diff
path: root/crypto/src/asn1/pkcs/PBKDF2Params.cs
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/src/asn1/pkcs/PBKDF2Params.cs')
-rw-r--r--crypto/src/asn1/pkcs/PBKDF2Params.cs8
1 files changed, 2 insertions, 6 deletions
diff --git a/crypto/src/asn1/pkcs/PBKDF2Params.cs b/crypto/src/asn1/pkcs/PBKDF2Params.cs
index 279f30de8..13f469c6c 100644
--- a/crypto/src/asn1/pkcs/PBKDF2Params.cs
+++ b/crypto/src/asn1/pkcs/PBKDF2Params.cs
@@ -126,13 +126,9 @@ namespace Org.BouncyCastle.Asn1.Pkcs
 
         public override Asn1Object ToAsn1Object()
         {
-            Asn1EncodableVector v = new Asn1EncodableVector(
-                octStr, iterationCount);
+            Asn1EncodableVector v = new Asn1EncodableVector(octStr, iterationCount);
+            v.AddOptional(keyLength);
 
-            if (keyLength != null)
-            {
-                v.Add(keyLength);
-            }
             if (!IsDefaultPrf)
             {
                 v.Add(prf);