]> git.saurik.com Git - apple/security.git/blobdiff - SecurityASN1/c++/sm_cms.cpp
Security-54.tar.gz
[apple/security.git] / SecurityASN1 / c++ / sm_cms.cpp
index 60b6c6f2dd5bea8995e7a60275bd617469b7e203..e8b1a95e13f8d74fb8a32e2c4a65b08de0cee71a 100644 (file)
@@ -2,7 +2,7 @@
 //
 // sm_cms.cpp - class member functions for ASN.1 module CryptographicMessageSyntax
 //
-//   This file was generated by snacc on Wed Jun 27 16:40:55 2001
+//   This file was generated by snacc on Mon Apr 22 22:34:19 2002
 //   UBC snacc written by Mike Sample
 //   A couple of enhancements made by IBM European Networking Center
 
@@ -24,6 +24,7 @@
 #include "pkcs7.h"
 #include "pkcs8.h"
 #include "appleoids.h"
+#include "pkcs10.h"
 
 //------------------------------------------------------------------------------
 // value defs
@@ -133,7 +134,7 @@ void OriginatorPublicKey::BDecContent (BUF_TYPE b, AsnTag /*tag0*/, AsnLen elmtL
   else
   {
     Asn1Error << "ERROR - SEQUENCE is missing non-optional elmt." << endl;
-    longjmp (env, -100);
+    SnaccExcep::throwMe(-100);
   }
 
   if ((tag1 == MAKE_TAG_ID (UNIV, PRIM, BITSTRING_TAG_CODE))
@@ -145,7 +146,7 @@ void OriginatorPublicKey::BDecContent (BUF_TYPE b, AsnTag /*tag0*/, AsnLen elmtL
   else
   {
     Asn1Error << "ERROR - SEQUENCE is missing non-optional elmt." << endl;
-    longjmp (env, -101);
+    SnaccExcep::throwMe(-101);
   }
 
   bytesDecoded += seqBytesDecoded;
@@ -157,7 +158,7 @@ void OriginatorPublicKey::BDecContent (BUF_TYPE b, AsnTag /*tag0*/, AsnLen elmtL
   else if (seqBytesDecoded != elmtLen0)
   {
     Asn1Error << "ERROR - Length discrepancy on sequence." << endl;
-    longjmp (env, -102);
+    SnaccExcep::throwMe(-102);
   }
   else
     return;
@@ -180,33 +181,12 @@ void OriginatorPublicKey::BDec (BUF_TYPE b, AsnLen &bytesDecoded, ENV_TYPE env)
   if ((tag = BDecTag (b, bytesDecoded, env)) != MAKE_TAG_ID (UNIV, CONS, SEQ_TAG_CODE))
   {
     Asn1Error << "OriginatorPublicKey::BDec: ERROR - wrong tag" << endl;
-    longjmp (env, -103);
+    SnaccExcep::throwMe(-103);
   }
   elmtLen1 = BDecLen (b, bytesDecoded, env);
   BDecContent (b, tag, elmtLen1, bytesDecoded, env);
 }
 
-int OriginatorPublicKey::BEncPdu (BUF_TYPE b, AsnLen &bytesEncoded)
-{
-    bytesEncoded = BEnc (b);
-    return !b.WriteError();
-}
-
-int OriginatorPublicKey::BDecPdu (BUF_TYPE b, AsnLen &bytesDecoded)
-{
-    ENV_TYPE env;
-    int val;
-
-    bytesDecoded = 0;
-    if ((val = setjmp (env)) == 0)
-    {
-         BDec (b, bytesDecoded, env);
-         return !b.ReadError();
-    }
-    else
-        return false;
-}
-
 void OriginatorPublicKey::Print (ostream &os) const
 {
 #ifndef NDEBUG
@@ -268,7 +248,7 @@ void CertificateRevocationLists::BDec (BUF_TYPE b, AsnLen &bytesDecoded, ENV_TYP
   if ((tag = BDecTag (b, bytesDecoded, env)) != MAKE_TAG_ID (UNIV, CONS, SET_TAG_CODE))
   {
     Asn1Error << "CertificateRevocationLists::BDec: ERROR - wrong tag" << endl;
-    longjmp (env, -104);
+    SnaccExcep::throwMe(-104);
   }
   elmtLen1 = BDecLen (b, bytesDecoded, env);
   BDecContent (b, tag, elmtLen1, bytesDecoded, env);
@@ -684,7 +664,7 @@ void  CertificateRevocationLists::BDecContent (BUF_TYPE b, AsnTag /*tag0*/, AsnL
         if ((tag1 != MAKE_TAG_ID (UNIV, CONS, SEQ_TAG_CODE)))
         {
             Asn1Error << "Unexpected Tag" << endl;
-            longjmp (env, -105);
+            SnaccExcep::throwMe(-105);
         }
 
         elmtLen1 = BDecLen (b, listBytesDecoded, env);
@@ -793,7 +773,7 @@ void IssuerAndSerialNumber::BDecContent (BUF_TYPE b, AsnTag /*tag0*/, AsnLen elm
   else
   {
     Asn1Error << "ERROR - SEQUENCE is missing non-optional elmt." << endl;
-    longjmp (env, -106);
+    SnaccExcep::throwMe(-106);
   }
 
   if ((tag1 == MAKE_TAG_ID (UNIV, PRIM, INTEGER_TAG_CODE))
@@ -805,7 +785,7 @@ void IssuerAndSerialNumber::BDecContent (BUF_TYPE b, AsnTag /*tag0*/, AsnLen elm
   else
   {
     Asn1Error << "ERROR - SEQUENCE is missing non-optional elmt." << endl;
-    longjmp (env, -107);
+    SnaccExcep::throwMe(-107);
   }
 
   bytesDecoded += seqBytesDecoded;
@@ -817,7 +797,7 @@ void IssuerAndSerialNumber::BDecContent (BUF_TYPE b, AsnTag /*tag0*/, AsnLen elm
   else if (seqBytesDecoded != elmtLen0)
   {
     Asn1Error << "ERROR - Length discrepancy on sequence." << endl;
-    longjmp (env, -108);
+    SnaccExcep::throwMe(-108);
   }
   else
     return;
@@ -840,33 +820,12 @@ void IssuerAndSerialNumber::BDec (BUF_TYPE b, AsnLen &bytesDecoded, ENV_TYPE env
   if ((tag = BDecTag (b, bytesDecoded, env)) != MAKE_TAG_ID (UNIV, CONS, SEQ_TAG_CODE))
   {
     Asn1Error << "IssuerAndSerialNumber::BDec: ERROR - wrong tag" << endl;
-    longjmp (env, -109);
+    SnaccExcep::throwMe(-109);
   }
   elmtLen1 = BDecLen (b, bytesDecoded, env);
   BDecContent (b, tag, elmtLen1, bytesDecoded, env);
 }
 
-int IssuerAndSerialNumber::BEncPdu (BUF_TYPE b, AsnLen &bytesEncoded)
-{
-    bytesEncoded = BEnc (b);
-    return !b.WriteError();
-}
-
-int IssuerAndSerialNumber::BDecPdu (BUF_TYPE b, AsnLen &bytesDecoded)
-{
-    ENV_TYPE env;
-    int val;
-
-    bytesDecoded = 0;
-    if ((val = setjmp (env)) == 0)
-    {
-         BDec (b, bytesDecoded, env);
-         return !b.ReadError();
-    }
-    else
-        return false;
-}
-
 void IssuerAndSerialNumber::Print (ostream &os) const
 {
 #ifndef NDEBUG
@@ -1012,7 +971,7 @@ void OtherKeyAttribute::BDecContent (BUF_TYPE b, AsnTag /*tag0*/, AsnLen elmtLen
   else
   {
     Asn1Error << "ERROR - SEQUENCE is missing non-optional elmt." << endl;
-    longjmp (env, -110);
+    SnaccExcep::throwMe(-110);
   }
 
   // ANY type
@@ -1029,7 +988,7 @@ void OtherKeyAttribute::BDecContent (BUF_TYPE b, AsnTag /*tag0*/, AsnLen elmtLen
   else if (seqBytesDecoded != elmtLen0)
   {
     Asn1Error << "ERROR - Length discrepancy on sequence." << endl;
-    longjmp (env, -111);
+    SnaccExcep::throwMe(-111);
   }
   else
     return;
@@ -1052,33 +1011,12 @@ void OtherKeyAttribute::BDec (BUF_TYPE b, AsnLen &bytesDecoded, ENV_TYPE env)
   if ((tag = BDecTag (b, bytesDecoded, env)) != MAKE_TAG_ID (UNIV, CONS, SEQ_TAG_CODE))
   {
     Asn1Error << "OtherKeyAttribute::BDec: ERROR - wrong tag" << endl;
-    longjmp (env, -112);
+    SnaccExcep::throwMe(-112);
   }
   elmtLen1 = BDecLen (b, bytesDecoded, env);
   BDecContent (b, tag, elmtLen1, bytesDecoded, env);
 }
 
-int OtherKeyAttribute::BEncPdu (BUF_TYPE b, AsnLen &bytesEncoded)
-{
-    bytesEncoded = BEnc (b);
-    return !b.WriteError();
-}
-
-int OtherKeyAttribute::BDecPdu (BUF_TYPE b, AsnLen &bytesDecoded)
-{
-    ENV_TYPE env;
-    int val;
-
-    bytesDecoded = 0;
-    if ((val = setjmp (env)) == 0)
-    {
-         BDec (b, bytesDecoded, env);
-         return !b.ReadError();
-    }
-    else
-        return false;
-}
-
 void OtherKeyAttribute::Print (ostream &os) const
 {
 #ifndef NDEBUG
@@ -1142,7 +1080,7 @@ void DigestAlgorithmIdentifiers::BDec (BUF_TYPE b, AsnLen &bytesDecoded, ENV_TYP
   if ((tag = BDecTag (b, bytesDecoded, env)) != MAKE_TAG_ID (UNIV, CONS, SET_TAG_CODE))
   {
     Asn1Error << "DigestAlgorithmIdentifiers::BDec: ERROR - wrong tag" << endl;
-    longjmp (env, -113);
+    SnaccExcep::throwMe(-113);
   }
   elmtLen1 = BDecLen (b, bytesDecoded, env);
   BDecContent (b, tag, elmtLen1, bytesDecoded, env);
@@ -1558,7 +1496,7 @@ void  DigestAlgorithmIdentifiers::BDecContent (BUF_TYPE b, AsnTag /*tag0*/, AsnL
         if ((tag1 != MAKE_TAG_ID (UNIV, CONS, SEQ_TAG_CODE)))
         {
             Asn1Error << "Unexpected Tag" << endl;
-            longjmp (env, -114);
+            SnaccExcep::throwMe(-114);
         }
 
         elmtLen1 = BDecLen (b, listBytesDecoded, env);
@@ -1688,7 +1626,7 @@ void EncapsulatedContentInfo::BDecContent (BUF_TYPE b, AsnTag /*tag0*/, AsnLen e
   else
   {
     Asn1Error << "ERROR - SEQUENCE is missing non-optional elmt." << endl;
-    longjmp (env, -115);
+    SnaccExcep::throwMe(-115);
   }
 
   if ((tag1 == MAKE_TAG_ID (CNTX, CONS, 0)))
@@ -1700,7 +1638,7 @@ void EncapsulatedContentInfo::BDecContent (BUF_TYPE b, AsnTag /*tag0*/, AsnLen e
        && (tag1 != MAKE_TAG_ID (UNIV, CONS, OCTETSTRING_TAG_CODE)))
     {
        Asn1Error << "Unexpected Tag" << endl;
-       longjmp (env, -116);
+       SnaccExcep::throwMe(-116);
     }
 
     elmtLen2 = BDecLen (b, seqBytesDecoded, env);
@@ -1720,7 +1658,7 @@ void EncapsulatedContentInfo::BDecContent (BUF_TYPE b, AsnTag /*tag0*/, AsnLen e
   else if (seqBytesDecoded != elmtLen0)
   {
     Asn1Error << "ERROR - Length discrepancy on sequence." << endl;
-    longjmp (env, -117);
+    SnaccExcep::throwMe(-117);
   }
   else
     return;
@@ -1743,33 +1681,12 @@ void EncapsulatedContentInfo::BDec (BUF_TYPE b, AsnLen &bytesDecoded, ENV_TYPE e
   if ((tag = BDecTag (b, bytesDecoded, env)) != MAKE_TAG_ID (UNIV, CONS, SEQ_TAG_CODE))
   {
     Asn1Error << "EncapsulatedContentInfo::BDec: ERROR - wrong tag" << endl;
-    longjmp (env, -118);
+    SnaccExcep::throwMe(-118);
   }
   elmtLen1 = BDecLen (b, bytesDecoded, env);
   BDecContent (b, tag, elmtLen1, bytesDecoded, env);
 }
 
-int EncapsulatedContentInfo::BEncPdu (BUF_TYPE b, AsnLen &bytesEncoded)
-{
-    bytesEncoded = BEnc (b);
-    return !b.WriteError();
-}
-
-int EncapsulatedContentInfo::BDecPdu (BUF_TYPE b, AsnLen &bytesDecoded)
-{
-    ENV_TYPE env;
-    int val;
-
-    bytesDecoded = 0;
-    if ((val = setjmp (env)) == 0)
-    {
-         BDec (b, bytesDecoded, env);
-         return !b.ReadError();
-    }
-    else
-        return false;
-}
-
 void EncapsulatedContentInfo::Print (ostream &os) const
 {
 #ifndef NDEBUG
@@ -1929,7 +1846,7 @@ void SignerIdentifier::BDecContent (BUF_TYPE b, AsnTag tag, AsnLen elmtLen0, Asn
 
     default:
       Asn1Error << "ERROR - unexpected tag in CHOICE" << endl;
-      longjmp (env, -119);
+      SnaccExcep::throwMe(-119);
       break;
   } // end switch
 } // SignerIdentifier::BDecContent
@@ -1954,27 +1871,6 @@ void SignerIdentifier::BDec (BUF_TYPE b, AsnLen &bytesDecoded, ENV_TYPE env)
     BDecContent (b, tag, elmtLen, bytesDecoded, env);
 }
 
-int SignerIdentifier::BEncPdu (BUF_TYPE b, AsnLen &bytesEncoded)
-{
-    bytesEncoded = BEnc (b);
-    return !b.WriteError();
-}
-
-int SignerIdentifier::BDecPdu (BUF_TYPE b, AsnLen &bytesDecoded)
-{
-    ENV_TYPE env;
-    int val;
-
-    bytesDecoded = 0;
-    if ((val = setjmp (env)) == 0)
-    {
-         BDec (b, bytesDecoded, env);
-         return !b.ReadError();
-    }
-    else
-        return false;
-}
-
 void SignerIdentifier::Print (ostream &os) const
 {
 #ifndef NDEBUG
@@ -2122,7 +2018,7 @@ void EncryptedContentInfo::BDecContent (BUF_TYPE b, AsnTag /*tag0*/, AsnLen elmt
   else
   {
     Asn1Error << "ERROR - SEQUENCE is missing non-optional elmt." << endl;
-    longjmp (env, -120);
+    SnaccExcep::throwMe(-120);
   }
 
   if ((tag1 == MAKE_TAG_ID (UNIV, CONS, SEQ_TAG_CODE)))
@@ -2150,7 +2046,7 @@ void EncryptedContentInfo::BDecContent (BUF_TYPE b, AsnTag /*tag0*/, AsnLen elmt
   else
   {
     Asn1Error << "ERROR - SEQUENCE is missing non-optional elmt." << endl;
-    longjmp (env, -121);
+    SnaccExcep::throwMe(-121);
   }
 
   if ((tag1 == MAKE_TAG_ID (CNTX, PRIM, 0))
@@ -2170,7 +2066,7 @@ void EncryptedContentInfo::BDecContent (BUF_TYPE b, AsnTag /*tag0*/, AsnLen elmt
   else if (seqBytesDecoded != elmtLen0)
   {
     Asn1Error << "ERROR - Length discrepancy on sequence." << endl;
-    longjmp (env, -122);
+    SnaccExcep::throwMe(-122);
   }
   else
     return;
@@ -2193,33 +2089,12 @@ void EncryptedContentInfo::BDec (BUF_TYPE b, AsnLen &bytesDecoded, ENV_TYPE env)
   if ((tag = BDecTag (b, bytesDecoded, env)) != MAKE_TAG_ID (UNIV, CONS, SEQ_TAG_CODE))
   {
     Asn1Error << "EncryptedContentInfo::BDec: ERROR - wrong tag" << endl;
-    longjmp (env, -123);
+    SnaccExcep::throwMe(-123);
   }
   elmtLen1 = BDecLen (b, bytesDecoded, env);
   BDecContent (b, tag, elmtLen1, bytesDecoded, env);
 }
 
-int EncryptedContentInfo::BEncPdu (BUF_TYPE b, AsnLen &bytesEncoded)
-{
-    bytesEncoded = BEnc (b);
-    return !b.WriteError();
-}
-
-int EncryptedContentInfo::BDecPdu (BUF_TYPE b, AsnLen &bytesDecoded)
-{
-    ENV_TYPE env;
-    int val;
-
-    bytesDecoded = 0;
-    if ((val = setjmp (env)) == 0)
-    {
-         BDec (b, bytesDecoded, env);
-         return !b.ReadError();
-    }
-    else
-        return false;
-}
-
 void EncryptedContentInfo::Print (ostream &os) const
 {
 #ifndef NDEBUG
@@ -2393,7 +2268,7 @@ void RecipientIdentifier::BDecContent (BUF_TYPE b, AsnTag tag, AsnLen elmtLen0,
 
     default:
       Asn1Error << "ERROR - unexpected tag in CHOICE" << endl;
-      longjmp (env, -124);
+      SnaccExcep::throwMe(-124);
       break;
   } // end switch
 } // RecipientIdentifier::BDecContent
@@ -2418,27 +2293,6 @@ void RecipientIdentifier::BDec (BUF_TYPE b, AsnLen &bytesDecoded, ENV_TYPE env)
     BDecContent (b, tag, elmtLen, bytesDecoded, env);
 }
 
-int RecipientIdentifier::BEncPdu (BUF_TYPE b, AsnLen &bytesEncoded)
-{
-    bytesEncoded = BEnc (b);
-    return !b.WriteError();
-}
-
-int RecipientIdentifier::BDecPdu (BUF_TYPE b, AsnLen &bytesDecoded)
-{
-    ENV_TYPE env;
-    int val;
-
-    bytesDecoded = 0;
-    if ((val = setjmp (env)) == 0)
-    {
-         BDec (b, bytesDecoded, env);
-         return !b.ReadError();
-    }
-    else
-        return false;
-}
-
 void RecipientIdentifier::Print (ostream &os) const
 {
 #ifndef NDEBUG
@@ -2611,7 +2465,7 @@ void OriginatorIdentifierOrKey::BDecContent (BUF_TYPE b, AsnTag tag, AsnLen elmt
 
     default:
       Asn1Error << "ERROR - unexpected tag in CHOICE" << endl;
-      longjmp (env, -125);
+      SnaccExcep::throwMe(-125);
       break;
   } // end switch
 } // OriginatorIdentifierOrKey::BDecContent
@@ -2636,27 +2490,6 @@ void OriginatorIdentifierOrKey::BDec (BUF_TYPE b, AsnLen &bytesDecoded, ENV_TYPE
     BDecContent (b, tag, elmtLen, bytesDecoded, env);
 }
 
-int OriginatorIdentifierOrKey::BEncPdu (BUF_TYPE b, AsnLen &bytesEncoded)
-{
-    bytesEncoded = BEnc (b);
-    return !b.WriteError();
-}
-
-int OriginatorIdentifierOrKey::BDecPdu (BUF_TYPE b, AsnLen &bytesDecoded)
-{
-    ENV_TYPE env;
-    int val;
-
-    bytesDecoded = 0;
-    if ((val = setjmp (env)) == 0)
-    {
-         BDec (b, bytesDecoded, env);
-         return !b.ReadError();
-    }
-    else
-        return false;
-}
-
 void OriginatorIdentifierOrKey::Print (ostream &os) const
 {
 #ifndef NDEBUG
@@ -2827,7 +2660,7 @@ void RecipientKeyIdentifier::BDecContent (BUF_TYPE b, AsnTag /*tag0*/, AsnLen el
   else
   {
     Asn1Error << "ERROR - SEQUENCE is missing non-optional elmt." << endl;
-    longjmp (env, -126);
+    SnaccExcep::throwMe(-126);
   }
 
   if ((tag1 == MAKE_TAG_ID (UNIV, PRIM, GENERALIZEDTIME_TAG_CODE))
@@ -2870,7 +2703,7 @@ void RecipientKeyIdentifier::BDecContent (BUF_TYPE b, AsnTag /*tag0*/, AsnLen el
   else if (seqBytesDecoded != elmtLen0)
   {
     Asn1Error << "ERROR - Length discrepancy on sequence." << endl;
-    longjmp (env, -127);
+    SnaccExcep::throwMe(-127);
   }
   else
     return;
@@ -2893,33 +2726,12 @@ void RecipientKeyIdentifier::BDec (BUF_TYPE b, AsnLen &bytesDecoded, ENV_TYPE en
   if ((tag = BDecTag (b, bytesDecoded, env)) != MAKE_TAG_ID (UNIV, CONS, SEQ_TAG_CODE))
   {
     Asn1Error << "RecipientKeyIdentifier::BDec: ERROR - wrong tag" << endl;
-    longjmp (env, -128);
+    SnaccExcep::throwMe(-128);
   }
   elmtLen1 = BDecLen (b, bytesDecoded, env);
   BDecContent (b, tag, elmtLen1, bytesDecoded, env);
 }
 
-int RecipientKeyIdentifier::BEncPdu (BUF_TYPE b, AsnLen &bytesEncoded)
-{
-    bytesEncoded = BEnc (b);
-    return !b.WriteError();
-}
-
-int RecipientKeyIdentifier::BDecPdu (BUF_TYPE b, AsnLen &bytesDecoded)
-{
-    ENV_TYPE env;
-    int val;
-
-    bytesDecoded = 0;
-    if ((val = setjmp (env)) == 0)
-    {
-         BDec (b, bytesDecoded, env);
-         return !b.ReadError();
-    }
-    else
-        return false;
-}
-
 void RecipientKeyIdentifier::Print (ostream &os) const
 {
 #ifndef NDEBUG
@@ -3108,7 +2920,7 @@ void KEKIdentifier::BDecContent (BUF_TYPE b, AsnTag /*tag0*/, AsnLen elmtLen0, A
   else
   {
     Asn1Error << "ERROR - SEQUENCE is missing non-optional elmt." << endl;
-    longjmp (env, -129);
+    SnaccExcep::throwMe(-129);
   }
 
   if ((tag1 == MAKE_TAG_ID (UNIV, PRIM, GENERALIZEDTIME_TAG_CODE))
@@ -3151,7 +2963,7 @@ void KEKIdentifier::BDecContent (BUF_TYPE b, AsnTag /*tag0*/, AsnLen elmtLen0, A
   else if (seqBytesDecoded != elmtLen0)
   {
     Asn1Error << "ERROR - Length discrepancy on sequence." << endl;
-    longjmp (env, -130);
+    SnaccExcep::throwMe(-130);
   }
   else
     return;
@@ -3174,33 +2986,12 @@ void KEKIdentifier::BDec (BUF_TYPE b, AsnLen &bytesDecoded, ENV_TYPE env)
   if ((tag = BDecTag (b, bytesDecoded, env)) != MAKE_TAG_ID (UNIV, CONS, SEQ_TAG_CODE))
   {
     Asn1Error << "KEKIdentifier::BDec: ERROR - wrong tag" << endl;
-    longjmp (env, -131);
+    SnaccExcep::throwMe(-131);
   }
   elmtLen1 = BDecLen (b, bytesDecoded, env);
   BDecContent (b, tag, elmtLen1, bytesDecoded, env);
 }
 
-int KEKIdentifier::BEncPdu (BUF_TYPE b, AsnLen &bytesEncoded)
-{
-    bytesEncoded = BEnc (b);
-    return !b.WriteError();
-}
-
-int KEKIdentifier::BDecPdu (BUF_TYPE b, AsnLen &bytesDecoded)
-{
-    ENV_TYPE env;
-    int val;
-
-    bytesDecoded = 0;
-    if ((val = setjmp (env)) == 0)
-    {
-         BDec (b, bytesDecoded, env);
-         return !b.ReadError();
-    }
-    else
-        return false;
-}
-
 void KEKIdentifier::Print (ostream &os) const
 {
 #ifndef NDEBUG
@@ -3361,7 +3152,7 @@ void ExtendedCertificateInfo::BDecContent (BUF_TYPE b, AsnTag /*tag0*/, AsnLen e
   else
   {
     Asn1Error << "ERROR - SEQUENCE is missing non-optional elmt." << endl;
-    longjmp (env, -132);
+    SnaccExcep::throwMe(-132);
   }
 
   if ((tag1 == MAKE_TAG_ID (UNIV, CONS, SEQ_TAG_CODE)))
@@ -3374,7 +3165,7 @@ void ExtendedCertificateInfo::BDecContent (BUF_TYPE b, AsnTag /*tag0*/, AsnLen e
   else
   {
     Asn1Error << "ERROR - SEQUENCE is missing non-optional elmt." << endl;
-    longjmp (env, -133);
+    SnaccExcep::throwMe(-133);
   }
 
   if ((tag1 == MAKE_TAG_ID (UNIV, CONS, SET_TAG_CODE)))
@@ -3385,7 +3176,7 @@ void ExtendedCertificateInfo::BDecContent (BUF_TYPE b, AsnTag /*tag0*/, AsnLen e
   else
   {
     Asn1Error << "ERROR - SEQUENCE is missing non-optional elmt." << endl;
-    longjmp (env, -134);
+    SnaccExcep::throwMe(-134);
   }
 
   bytesDecoded += seqBytesDecoded;
@@ -3397,7 +3188,7 @@ void ExtendedCertificateInfo::BDecContent (BUF_TYPE b, AsnTag /*tag0*/, AsnLen e
   else if (seqBytesDecoded != elmtLen0)
   {
     Asn1Error << "ERROR - Length discrepancy on sequence." << endl;
-    longjmp (env, -135);
+    SnaccExcep::throwMe(-135);
   }
   else
     return;
@@ -3420,33 +3211,12 @@ void ExtendedCertificateInfo::BDec (BUF_TYPE b, AsnLen &bytesDecoded, ENV_TYPE e
   if ((tag = BDecTag (b, bytesDecoded, env)) != MAKE_TAG_ID (UNIV, CONS, SEQ_TAG_CODE))
   {
     Asn1Error << "ExtendedCertificateInfo::BDec: ERROR - wrong tag" << endl;
-    longjmp (env, -136);
+    SnaccExcep::throwMe(-136);
   }
   elmtLen1 = BDecLen (b, bytesDecoded, env);
   BDecContent (b, tag, elmtLen1, bytesDecoded, env);
 }
 
-int ExtendedCertificateInfo::BEncPdu (BUF_TYPE b, AsnLen &bytesEncoded)
-{
-    bytesEncoded = BEnc (b);
-    return !b.WriteError();
-}
-
-int ExtendedCertificateInfo::BDecPdu (BUF_TYPE b, AsnLen &bytesDecoded)
-{
-    ENV_TYPE env;
-    int val;
-
-    bytesDecoded = 0;
-    if ((val = setjmp (env)) == 0)
-    {
-         BDec (b, bytesDecoded, env);
-         return !b.ReadError();
-    }
-    else
-        return false;
-}
-
 void ExtendedCertificateInfo::Print (ostream &os) const
 {
 #ifndef NDEBUG
@@ -3686,7 +3456,7 @@ void SignerInfo::BDecContent (BUF_TYPE b, AsnTag /*tag0*/, AsnLen elmtLen0, AsnL
   else
   {
     Asn1Error << "ERROR - SEQUENCE is missing non-optional elmt." << endl;
-    longjmp (env, -137);
+    SnaccExcep::throwMe(-137);
   }
 
   if ((tag1 == MAKE_TAG_ID (UNIV, CONS, SEQ_TAG_CODE))
@@ -3701,7 +3471,7 @@ void SignerInfo::BDecContent (BUF_TYPE b, AsnTag /*tag0*/, AsnLen elmtLen0, AsnL
   else
   {
     Asn1Error << "ERROR - SEQUENCE is missing non-optional elmt." << endl;
-    longjmp (env, -138);
+    SnaccExcep::throwMe(-138);
   }
 
   if ((tag1 == MAKE_TAG_ID (UNIV, CONS, SEQ_TAG_CODE)))
@@ -3714,7 +3484,7 @@ void SignerInfo::BDecContent (BUF_TYPE b, AsnTag /*tag0*/, AsnLen elmtLen0, AsnL
   else
   {
     Asn1Error << "ERROR - SEQUENCE is missing non-optional elmt." << endl;
-    longjmp (env, -139);
+    SnaccExcep::throwMe(-139);
   }
 
   if ((tag1 == MAKE_TAG_ID (CNTX, CONS, 0)))
@@ -3735,7 +3505,7 @@ void SignerInfo::BDecContent (BUF_TYPE b, AsnTag /*tag0*/, AsnLen elmtLen0, AsnL
   else
   {
     Asn1Error << "ERROR - SEQUENCE is missing non-optional elmt." << endl;
-    longjmp (env, -140);
+    SnaccExcep::throwMe(-140);
   }
 
   if ((tag1 == MAKE_TAG_ID (UNIV, PRIM, OCTETSTRING_TAG_CODE))
@@ -3763,7 +3533,7 @@ void SignerInfo::BDecContent (BUF_TYPE b, AsnTag /*tag0*/, AsnLen elmtLen0, AsnL
   else
   {
     Asn1Error << "ERROR - SEQUENCE is missing non-optional elmt." << endl;
-    longjmp (env, -141);
+    SnaccExcep::throwMe(-141);
   }
 
   if ((tag1 == MAKE_TAG_ID (CNTX, CONS, 1)))
@@ -3782,7 +3552,7 @@ void SignerInfo::BDecContent (BUF_TYPE b, AsnTag /*tag0*/, AsnLen elmtLen0, AsnL
   else if (seqBytesDecoded != elmtLen0)
   {
     Asn1Error << "ERROR - Length discrepancy on sequence." << endl;
-    longjmp (env, -142);
+    SnaccExcep::throwMe(-142);
   }
   else
     return;
@@ -3805,33 +3575,12 @@ void SignerInfo::BDec (BUF_TYPE b, AsnLen &bytesDecoded, ENV_TYPE env)
   if ((tag = BDecTag (b, bytesDecoded, env)) != MAKE_TAG_ID (UNIV, CONS, SEQ_TAG_CODE))
   {
     Asn1Error << "SignerInfo::BDec: ERROR - wrong tag" << endl;
-    longjmp (env, -143);
+    SnaccExcep::throwMe(-143);
   }
   elmtLen1 = BDecLen (b, bytesDecoded, env);
   BDecContent (b, tag, elmtLen1, bytesDecoded, env);
 }
 
-int SignerInfo::BEncPdu (BUF_TYPE b, AsnLen &bytesEncoded)
-{
-    bytesEncoded = BEnc (b);
-    return !b.WriteError();
-}
-
-int SignerInfo::BDecPdu (BUF_TYPE b, AsnLen &bytesDecoded)
-{
-    ENV_TYPE env;
-    int val;
-
-    bytesDecoded = 0;
-    if ((val = setjmp (env)) == 0)
-    {
-         BDec (b, bytesDecoded, env);
-         return !b.ReadError();
-    }
-    else
-        return false;
-}
-
 void SignerInfo::Print (ostream &os) const
 {
 #ifndef NDEBUG
@@ -4059,7 +3808,7 @@ void KeyTransRecipientInfo::BDecContent (BUF_TYPE b, AsnTag /*tag0*/, AsnLen elm
   else
   {
     Asn1Error << "ERROR - SEQUENCE is missing non-optional elmt." << endl;
-    longjmp (env, -144);
+    SnaccExcep::throwMe(-144);
   }
 
   if ((tag1 == MAKE_TAG_ID (UNIV, CONS, SEQ_TAG_CODE))
@@ -4074,7 +3823,7 @@ void KeyTransRecipientInfo::BDecContent (BUF_TYPE b, AsnTag /*tag0*/, AsnLen elm
   else
   {
     Asn1Error << "ERROR - SEQUENCE is missing non-optional elmt." << endl;
-    longjmp (env, -145);
+    SnaccExcep::throwMe(-145);
   }
 
   if ((tag1 == MAKE_TAG_ID (UNIV, CONS, SEQ_TAG_CODE)))
@@ -4087,7 +3836,7 @@ void KeyTransRecipientInfo::BDecContent (BUF_TYPE b, AsnTag /*tag0*/, AsnLen elm
   else
   {
     Asn1Error << "ERROR - SEQUENCE is missing non-optional elmt." << endl;
-    longjmp (env, -146);
+    SnaccExcep::throwMe(-146);
   }
 
   if ((tag1 == MAKE_TAG_ID (UNIV, PRIM, OCTETSTRING_TAG_CODE))
@@ -4099,7 +3848,7 @@ void KeyTransRecipientInfo::BDecContent (BUF_TYPE b, AsnTag /*tag0*/, AsnLen elm
   else
   {
     Asn1Error << "ERROR - SEQUENCE is missing non-optional elmt." << endl;
-    longjmp (env, -147);
+    SnaccExcep::throwMe(-147);
   }
 
   bytesDecoded += seqBytesDecoded;
@@ -4111,7 +3860,7 @@ void KeyTransRecipientInfo::BDecContent (BUF_TYPE b, AsnTag /*tag0*/, AsnLen elm
   else if (seqBytesDecoded != elmtLen0)
   {
     Asn1Error << "ERROR - Length discrepancy on sequence." << endl;
-    longjmp (env, -148);
+    SnaccExcep::throwMe(-148);
   }
   else
     return;
@@ -4134,33 +3883,12 @@ void KeyTransRecipientInfo::BDec (BUF_TYPE b, AsnLen &bytesDecoded, ENV_TYPE env
   if ((tag = BDecTag (b, bytesDecoded, env)) != MAKE_TAG_ID (UNIV, CONS, SEQ_TAG_CODE))
   {
     Asn1Error << "KeyTransRecipientInfo::BDec: ERROR - wrong tag" << endl;
-    longjmp (env, -149);
+    SnaccExcep::throwMe(-149);
   }
   elmtLen1 = BDecLen (b, bytesDecoded, env);
   BDecContent (b, tag, elmtLen1, bytesDecoded, env);
 }
 
-int KeyTransRecipientInfo::BEncPdu (BUF_TYPE b, AsnLen &bytesEncoded)
-{
-    bytesEncoded = BEnc (b);
-    return !b.WriteError();
-}
-
-int KeyTransRecipientInfo::BDecPdu (BUF_TYPE b, AsnLen &bytesDecoded)
-{
-    ENV_TYPE env;
-    int val;
-
-    bytesDecoded = 0;
-    if ((val = setjmp (env)) == 0)
-    {
-         BDec (b, bytesDecoded, env);
-         return !b.ReadError();
-    }
-    else
-        return false;
-}
-
 void KeyTransRecipientInfo::Print (ostream &os) const
 {
 #ifndef NDEBUG
@@ -4339,7 +4067,7 @@ void KeyAgreeRecipientIdentifier::BDecContent (BUF_TYPE b, AsnTag tag, AsnLen el
 
     default:
       Asn1Error << "ERROR - unexpected tag in CHOICE" << endl;
-      longjmp (env, -150);
+      SnaccExcep::throwMe(-150);
       break;
   } // end switch
 } // KeyAgreeRecipientIdentifier::BDecContent
@@ -4364,27 +4092,6 @@ void KeyAgreeRecipientIdentifier::BDec (BUF_TYPE b, AsnLen &bytesDecoded, ENV_TY
     BDecContent (b, tag, elmtLen, bytesDecoded, env);
 }
 
-int KeyAgreeRecipientIdentifier::BEncPdu (BUF_TYPE b, AsnLen &bytesEncoded)
-{
-    bytesEncoded = BEnc (b);
-    return !b.WriteError();
-}
-
-int KeyAgreeRecipientIdentifier::BDecPdu (BUF_TYPE b, AsnLen &bytesDecoded)
-{
-    ENV_TYPE env;
-    int val;
-
-    bytesDecoded = 0;
-    if ((val = setjmp (env)) == 0)
-    {
-         BDec (b, bytesDecoded, env);
-         return !b.ReadError();
-    }
-    else
-        return false;
-}
-
 void KeyAgreeRecipientIdentifier::Print (ostream &os) const
 {
 #ifndef NDEBUG
@@ -4542,7 +4249,7 @@ void KEKRecipientInfo::BDecContent (BUF_TYPE b, AsnTag /*tag0*/, AsnLen elmtLen0
   else
   {
     Asn1Error << "ERROR - SEQUENCE is missing non-optional elmt." << endl;
-    longjmp (env, -151);
+    SnaccExcep::throwMe(-151);
   }
 
   if ((tag1 == MAKE_TAG_ID (UNIV, CONS, SEQ_TAG_CODE)))
@@ -4555,7 +4262,7 @@ void KEKRecipientInfo::BDecContent (BUF_TYPE b, AsnTag /*tag0*/, AsnLen elmtLen0
   else
   {
     Asn1Error << "ERROR - SEQUENCE is missing non-optional elmt." << endl;
-    longjmp (env, -152);
+    SnaccExcep::throwMe(-152);
   }
 
   if ((tag1 == MAKE_TAG_ID (UNIV, CONS, SEQ_TAG_CODE)))
@@ -4568,7 +4275,7 @@ void KEKRecipientInfo::BDecContent (BUF_TYPE b, AsnTag /*tag0*/, AsnLen elmtLen0
   else
   {
     Asn1Error << "ERROR - SEQUENCE is missing non-optional elmt." << endl;
-    longjmp (env, -153);
+    SnaccExcep::throwMe(-153);
   }
 
   if ((tag1 == MAKE_TAG_ID (UNIV, PRIM, OCTETSTRING_TAG_CODE))
@@ -4580,7 +4287,7 @@ void KEKRecipientInfo::BDecContent (BUF_TYPE b, AsnTag /*tag0*/, AsnLen elmtLen0
   else
   {
     Asn1Error << "ERROR - SEQUENCE is missing non-optional elmt." << endl;
-    longjmp (env, -154);
+    SnaccExcep::throwMe(-154);
   }
 
   bytesDecoded += seqBytesDecoded;
@@ -4592,7 +4299,7 @@ void KEKRecipientInfo::BDecContent (BUF_TYPE b, AsnTag /*tag0*/, AsnLen elmtLen0
   else if (seqBytesDecoded != elmtLen0)
   {
     Asn1Error << "ERROR - Length discrepancy on sequence." << endl;
-    longjmp (env, -155);
+    SnaccExcep::throwMe(-155);
   }
   else
     return;
@@ -4615,33 +4322,12 @@ void KEKRecipientInfo::BDec (BUF_TYPE b, AsnLen &bytesDecoded, ENV_TYPE env)
   if ((tag = BDecTag (b, bytesDecoded, env)) != MAKE_TAG_ID (UNIV, CONS, SEQ_TAG_CODE))
   {
     Asn1Error << "KEKRecipientInfo::BDec: ERROR - wrong tag" << endl;
-    longjmp (env, -156);
+    SnaccExcep::throwMe(-156);
   }
   elmtLen1 = BDecLen (b, bytesDecoded, env);
   BDecContent (b, tag, elmtLen1, bytesDecoded, env);
 }
 
-int KEKRecipientInfo::BEncPdu (BUF_TYPE b, AsnLen &bytesEncoded)
-{
-    bytesEncoded = BEnc (b);
-    return !b.WriteError();
-}
-
-int KEKRecipientInfo::BDecPdu (BUF_TYPE b, AsnLen &bytesDecoded)
-{
-    ENV_TYPE env;
-    int val;
-
-    bytesDecoded = 0;
-    if ((val = setjmp (env)) == 0)
-    {
-         BDec (b, bytesDecoded, env);
-         return !b.ReadError();
-    }
-    else
-        return false;
-}
-
 void KEKRecipientInfo::Print (ostream &os) const
 {
 #ifndef NDEBUG
@@ -4822,7 +4508,7 @@ void ExtendedCertificate::BDecContent (BUF_TYPE b, AsnTag /*tag0*/, AsnLen elmtL
   else
   {
     Asn1Error << "ERROR - SEQUENCE is missing non-optional elmt." << endl;
-    longjmp (env, -157);
+    SnaccExcep::throwMe(-157);
   }
 
   if ((tag1 == MAKE_TAG_ID (UNIV, CONS, SEQ_TAG_CODE)))
@@ -4835,7 +4521,7 @@ void ExtendedCertificate::BDecContent (BUF_TYPE b, AsnTag /*tag0*/, AsnLen elmtL
   else
   {
     Asn1Error << "ERROR - SEQUENCE is missing non-optional elmt." << endl;
-    longjmp (env, -158);
+    SnaccExcep::throwMe(-158);
   }
 
   if ((tag1 == MAKE_TAG_ID (UNIV, PRIM, BITSTRING_TAG_CODE))
@@ -4847,7 +4533,7 @@ void ExtendedCertificate::BDecContent (BUF_TYPE b, AsnTag /*tag0*/, AsnLen elmtL
   else
   {
     Asn1Error << "ERROR - SEQUENCE is missing non-optional elmt." << endl;
-    longjmp (env, -159);
+    SnaccExcep::throwMe(-159);
   }
 
   bytesDecoded += seqBytesDecoded;
@@ -4859,7 +4545,7 @@ void ExtendedCertificate::BDecContent (BUF_TYPE b, AsnTag /*tag0*/, AsnLen elmtL
   else if (seqBytesDecoded != elmtLen0)
   {
     Asn1Error << "ERROR - Length discrepancy on sequence." << endl;
-    longjmp (env, -160);
+    SnaccExcep::throwMe(-160);
   }
   else
     return;
@@ -4882,33 +4568,12 @@ void ExtendedCertificate::BDec (BUF_TYPE b, AsnLen &bytesDecoded, ENV_TYPE env)
   if ((tag = BDecTag (b, bytesDecoded, env)) != MAKE_TAG_ID (UNIV, CONS, SEQ_TAG_CODE))
   {
     Asn1Error << "ExtendedCertificate::BDec: ERROR - wrong tag" << endl;
-    longjmp (env, -161);
+    SnaccExcep::throwMe(-161);
   }
   elmtLen1 = BDecLen (b, bytesDecoded, env);
   BDecContent (b, tag, elmtLen1, bytesDecoded, env);
 }
 
-int ExtendedCertificate::BEncPdu (BUF_TYPE b, AsnLen &bytesEncoded)
-{
-    bytesEncoded = BEnc (b);
-    return !b.WriteError();
-}
-
-int ExtendedCertificate::BDecPdu (BUF_TYPE b, AsnLen &bytesDecoded)
-{
-    ENV_TYPE env;
-    int val;
-
-    bytesDecoded = 0;
-    if ((val = setjmp (env)) == 0)
-    {
-         BDec (b, bytesDecoded, env);
-         return !b.ReadError();
-    }
-    else
-        return false;
-}
-
 void ExtendedCertificate::Print (ostream &os) const
 {
 #ifndef NDEBUG
@@ -4984,7 +4649,7 @@ void SignerInfos::BDec (BUF_TYPE b, AsnLen &bytesDecoded, ENV_TYPE env)
   if ((tag = BDecTag (b, bytesDecoded, env)) != MAKE_TAG_ID (UNIV, CONS, SET_TAG_CODE))
   {
     Asn1Error << "SignerInfos::BDec: ERROR - wrong tag" << endl;
-    longjmp (env, -162);
+    SnaccExcep::throwMe(-162);
   }
   elmtLen1 = BDecLen (b, bytesDecoded, env);
   BDecContent (b, tag, elmtLen1, bytesDecoded, env);
@@ -5400,7 +5065,7 @@ void  SignerInfos::BDecContent (BUF_TYPE b, AsnTag /*tag0*/, AsnLen elmtLen0,
         if ((tag1 != MAKE_TAG_ID (UNIV, CONS, SEQ_TAG_CODE)))
         {
             Asn1Error << "Unexpected Tag" << endl;
-            longjmp (env, -163);
+            SnaccExcep::throwMe(-163);
         }
 
         elmtLen1 = BDecLen (b, listBytesDecoded, env);
@@ -5510,7 +5175,7 @@ void RecipientEncryptedKey::BDecContent (BUF_TYPE b, AsnTag /*tag0*/, AsnLen elm
   else
   {
     Asn1Error << "ERROR - SEQUENCE is missing non-optional elmt." << endl;
-    longjmp (env, -164);
+    SnaccExcep::throwMe(-164);
   }
 
   if ((tag1 == MAKE_TAG_ID (UNIV, PRIM, OCTETSTRING_TAG_CODE))
@@ -5522,7 +5187,7 @@ void RecipientEncryptedKey::BDecContent (BUF_TYPE b, AsnTag /*tag0*/, AsnLen elm
   else
   {
     Asn1Error << "ERROR - SEQUENCE is missing non-optional elmt." << endl;
-    longjmp (env, -165);
+    SnaccExcep::throwMe(-165);
   }
 
   bytesDecoded += seqBytesDecoded;
@@ -5534,7 +5199,7 @@ void RecipientEncryptedKey::BDecContent (BUF_TYPE b, AsnTag /*tag0*/, AsnLen elm
   else if (seqBytesDecoded != elmtLen0)
   {
     Asn1Error << "ERROR - Length discrepancy on sequence." << endl;
-    longjmp (env, -166);
+    SnaccExcep::throwMe(-166);
   }
   else
     return;
@@ -5557,33 +5222,12 @@ void RecipientEncryptedKey::BDec (BUF_TYPE b, AsnLen &bytesDecoded, ENV_TYPE env
   if ((tag = BDecTag (b, bytesDecoded, env)) != MAKE_TAG_ID (UNIV, CONS, SEQ_TAG_CODE))
   {
     Asn1Error << "RecipientEncryptedKey::BDec: ERROR - wrong tag" << endl;
-    longjmp (env, -167);
+    SnaccExcep::throwMe(-167);
   }
   elmtLen1 = BDecLen (b, bytesDecoded, env);
   BDecContent (b, tag, elmtLen1, bytesDecoded, env);
 }
 
-int RecipientEncryptedKey::BEncPdu (BUF_TYPE b, AsnLen &bytesEncoded)
-{
-    bytesEncoded = BEnc (b);
-    return !b.WriteError();
-}
-
-int RecipientEncryptedKey::BDecPdu (BUF_TYPE b, AsnLen &bytesDecoded)
-{
-    ENV_TYPE env;
-    int val;
-
-    bytesDecoded = 0;
-    if ((val = setjmp (env)) == 0)
-    {
-         BDec (b, bytesDecoded, env);
-         return !b.ReadError();
-    }
-    else
-        return false;
-}
-
 void RecipientEncryptedKey::Print (ostream &os) const
 {
 #ifndef NDEBUG
@@ -5765,7 +5409,7 @@ void CertificateChoices::BDecContent (BUF_TYPE b, AsnTag tag, AsnLen elmtLen0, A
 
     default:
       Asn1Error << "ERROR - unexpected tag in CHOICE" << endl;
-      longjmp (env, -168);
+      SnaccExcep::throwMe(-168);
       break;
   } // end switch
 } // CertificateChoices::BDecContent
@@ -5790,27 +5434,6 @@ void CertificateChoices::BDec (BUF_TYPE b, AsnLen &bytesDecoded, ENV_TYPE env)
     BDecContent (b, tag, elmtLen, bytesDecoded, env);
 }
 
-int CertificateChoices::BEncPdu (BUF_TYPE b, AsnLen &bytesEncoded)
-{
-    bytesEncoded = BEnc (b);
-    return !b.WriteError();
-}
-
-int CertificateChoices::BDecPdu (BUF_TYPE b, AsnLen &bytesDecoded)
-{
-    ENV_TYPE env;
-    int val;
-
-    bytesDecoded = 0;
-    if ((val = setjmp (env)) == 0)
-    {
-         BDec (b, bytesDecoded, env);
-         return !b.ReadError();
-    }
-    else
-        return false;
-}
-
 void CertificateChoices::Print (ostream &os) const
 {
 #ifndef NDEBUG
@@ -5871,7 +5494,7 @@ void CertificateSet::BDec (BUF_TYPE b, AsnLen &bytesDecoded, ENV_TYPE env)
   if ((tag = BDecTag (b, bytesDecoded, env)) != MAKE_TAG_ID (UNIV, CONS, SET_TAG_CODE))
   {
     Asn1Error << "CertificateSet::BDec: ERROR - wrong tag" << endl;
-    longjmp (env, -169);
+    SnaccExcep::throwMe(-169);
   }
   elmtLen1 = BDecLen (b, bytesDecoded, env);
   BDecContent (b, tag, elmtLen1, bytesDecoded, env);
@@ -6285,7 +5908,7 @@ void  CertificateSet::BDecContent (BUF_TYPE b, AsnTag /*tag0*/, AsnLen elmtLen0,
          || (tag1 == MAKE_TAG_ID (CNTX, CONS, 1))))
         {
             Asn1Error << "Unexpected Tag" << endl;
-            longjmp (env, -170);
+            SnaccExcep::throwMe(-170);
         }
 
         elmtLen1 = BDecLen (b, listBytesDecoded, env);
@@ -6454,7 +6077,7 @@ void OriginatorInfo::BDecContent (BUF_TYPE b, AsnTag /*tag0*/, AsnLen elmtLen0,
   else if (seqBytesDecoded != elmtLen0)
   {
     Asn1Error << "ERROR - Length discrepancy on sequence." << endl;
-    longjmp (env, -171);
+    SnaccExcep::throwMe(-171);
   }
   else
     return;
@@ -6477,33 +6100,12 @@ void OriginatorInfo::BDec (BUF_TYPE b, AsnLen &bytesDecoded, ENV_TYPE env)
   if ((tag = BDecTag (b, bytesDecoded, env)) != MAKE_TAG_ID (UNIV, CONS, SEQ_TAG_CODE))
   {
     Asn1Error << "OriginatorInfo::BDec: ERROR - wrong tag" << endl;
-    longjmp (env, -172);
+    SnaccExcep::throwMe(-172);
   }
   elmtLen1 = BDecLen (b, bytesDecoded, env);
   BDecContent (b, tag, elmtLen1, bytesDecoded, env);
 }
 
-int OriginatorInfo::BEncPdu (BUF_TYPE b, AsnLen &bytesEncoded)
-{
-    bytesEncoded = BEnc (b);
-    return !b.WriteError();
-}
-
-int OriginatorInfo::BDecPdu (BUF_TYPE b, AsnLen &bytesDecoded)
-{
-    ENV_TYPE env;
-    int val;
-
-    bytesDecoded = 0;
-    if ((val = setjmp (env)) == 0)
-    {
-         BDec (b, bytesDecoded, env);
-         return !b.ReadError();
-    }
-    else
-        return false;
-}
-
 void OriginatorInfo::Print (ostream &os) const
 {
 #ifndef NDEBUG
@@ -6578,7 +6180,7 @@ void RecipientEncryptedKeys::BDec (BUF_TYPE b, AsnLen &bytesDecoded, ENV_TYPE en
   if ((tag = BDecTag (b, bytesDecoded, env)) != MAKE_TAG_ID (UNIV, CONS, SEQ_TAG_CODE))
   {
     Asn1Error << "RecipientEncryptedKeys::BDec: ERROR - wrong tag" << endl;
-    longjmp (env, -173);
+    SnaccExcep::throwMe(-173);
   }
   elmtLen1 = BDecLen (b, bytesDecoded, env);
   BDecContent (b, tag, elmtLen1, bytesDecoded, env);
@@ -6982,7 +6584,7 @@ void  RecipientEncryptedKeys::BDecContent (BUF_TYPE b, AsnTag /*tag0*/, AsnLen e
         if ((tag1 != MAKE_TAG_ID (UNIV, CONS, SEQ_TAG_CODE)))
         {
             Asn1Error << "Unexpected Tag" << endl;
-            longjmp (env, -174);
+            SnaccExcep::throwMe(-174);
         }
 
         elmtLen1 = BDecLen (b, listBytesDecoded, env);
@@ -7154,7 +6756,7 @@ void KeyAgreeRecipientInfo::BDecContent (BUF_TYPE b, AsnTag /*tag0*/, AsnLen elm
   else
   {
     Asn1Error << "ERROR - SEQUENCE is missing non-optional elmt." << endl;
-    longjmp (env, -175);
+    SnaccExcep::throwMe(-175);
   }
 
   if ((tag1 == MAKE_TAG_ID (CNTX, CONS, 0)))
@@ -7172,7 +6774,7 @@ void KeyAgreeRecipientInfo::BDecContent (BUF_TYPE b, AsnTag /*tag0*/, AsnLen elm
   else
   {
     Asn1Error << "ERROR - SEQUENCE is missing non-optional elmt." << endl;
-    longjmp (env, -176);
+    SnaccExcep::throwMe(-176);
   }
 
   if ((tag1 == MAKE_TAG_ID (CNTX, CONS, 1)))
@@ -7184,7 +6786,7 @@ void KeyAgreeRecipientInfo::BDecContent (BUF_TYPE b, AsnTag /*tag0*/, AsnLen elm
        && (tag1 != MAKE_TAG_ID (UNIV, CONS, OCTETSTRING_TAG_CODE)))
     {
        Asn1Error << "Unexpected Tag" << endl;
-       longjmp (env, -177);
+       SnaccExcep::throwMe(-177);
     }
 
     elmtLen2 = BDecLen (b, seqBytesDecoded, env);
@@ -7206,7 +6808,7 @@ void KeyAgreeRecipientInfo::BDecContent (BUF_TYPE b, AsnTag /*tag0*/, AsnLen elm
   else
   {
     Asn1Error << "ERROR - SEQUENCE is missing non-optional elmt." << endl;
-    longjmp (env, -178);
+    SnaccExcep::throwMe(-178);
   }
 
   if ((tag1 == MAKE_TAG_ID (UNIV, CONS, SEQ_TAG_CODE)))
@@ -7217,7 +6819,7 @@ void KeyAgreeRecipientInfo::BDecContent (BUF_TYPE b, AsnTag /*tag0*/, AsnLen elm
   else
   {
     Asn1Error << "ERROR - SEQUENCE is missing non-optional elmt." << endl;
-    longjmp (env, -179);
+    SnaccExcep::throwMe(-179);
   }
 
   bytesDecoded += seqBytesDecoded;
@@ -7229,7 +6831,7 @@ void KeyAgreeRecipientInfo::BDecContent (BUF_TYPE b, AsnTag /*tag0*/, AsnLen elm
   else if (seqBytesDecoded != elmtLen0)
   {
     Asn1Error << "ERROR - Length discrepancy on sequence." << endl;
-    longjmp (env, -180);
+    SnaccExcep::throwMe(-180);
   }
   else
     return;
@@ -7252,33 +6854,12 @@ void KeyAgreeRecipientInfo::BDec (BUF_TYPE b, AsnLen &bytesDecoded, ENV_TYPE env
   if ((tag = BDecTag (b, bytesDecoded, env)) != MAKE_TAG_ID (UNIV, CONS, SEQ_TAG_CODE))
   {
     Asn1Error << "KeyAgreeRecipientInfo::BDec: ERROR - wrong tag" << endl;
-    longjmp (env, -181);
+    SnaccExcep::throwMe(-181);
   }
   elmtLen1 = BDecLen (b, bytesDecoded, env);
   BDecContent (b, tag, elmtLen1, bytesDecoded, env);
 }
 
-int KeyAgreeRecipientInfo::BEncPdu (BUF_TYPE b, AsnLen &bytesEncoded)
-{
-    bytesEncoded = BEnc (b);
-    return !b.WriteError();
-}
-
-int KeyAgreeRecipientInfo::BDecPdu (BUF_TYPE b, AsnLen &bytesDecoded)
-{
-    ENV_TYPE env;
-    int val;
-
-    bytesDecoded = 0;
-    if ((val = setjmp (env)) == 0)
-    {
-         BDec (b, bytesDecoded, env);
-         return !b.ReadError();
-    }
-    else
-        return false;
-}
-
 void KeyAgreeRecipientInfo::Print (ostream &os) const
 {
 #ifndef NDEBUG
@@ -7495,7 +7076,7 @@ void RecipientInfo::BDecContent (BUF_TYPE b, AsnTag tag, AsnLen elmtLen0, AsnLen
 
     default:
       Asn1Error << "ERROR - unexpected tag in CHOICE" << endl;
-      longjmp (env, -182);
+      SnaccExcep::throwMe(-182);
       break;
   } // end switch
 } // RecipientInfo::BDecContent
@@ -7520,27 +7101,6 @@ void RecipientInfo::BDec (BUF_TYPE b, AsnLen &bytesDecoded, ENV_TYPE env)
     BDecContent (b, tag, elmtLen, bytesDecoded, env);
 }
 
-int RecipientInfo::BEncPdu (BUF_TYPE b, AsnLen &bytesEncoded)
-{
-    bytesEncoded = BEnc (b);
-    return !b.WriteError();
-}
-
-int RecipientInfo::BDecPdu (BUF_TYPE b, AsnLen &bytesDecoded)
-{
-    ENV_TYPE env;
-    int val;
-
-    bytesDecoded = 0;
-    if ((val = setjmp (env)) == 0)
-    {
-         BDec (b, bytesDecoded, env);
-         return !b.ReadError();
-    }
-    else
-        return false;
-}
-
 void RecipientInfo::Print (ostream &os) const
 {
 #ifndef NDEBUG
@@ -7601,7 +7161,7 @@ void RecipientInfos::BDec (BUF_TYPE b, AsnLen &bytesDecoded, ENV_TYPE env)
   if ((tag = BDecTag (b, bytesDecoded, env)) != MAKE_TAG_ID (UNIV, CONS, SET_TAG_CODE))
   {
     Asn1Error << "RecipientInfos::BDec: ERROR - wrong tag" << endl;
-    longjmp (env, -183);
+    SnaccExcep::throwMe(-183);
   }
   elmtLen1 = BDecLen (b, bytesDecoded, env);
   BDecContent (b, tag, elmtLen1, bytesDecoded, env);
@@ -8015,7 +7575,7 @@ void  RecipientInfos::BDecContent (BUF_TYPE b, AsnTag /*tag0*/, AsnLen elmtLen0,
          || (tag1 == MAKE_TAG_ID (CNTX, CONS, 2))))
         {
             Asn1Error << "Unexpected Tag" << endl;
-            longjmp (env, -184);
+            SnaccExcep::throwMe(-184);
         }
 
         elmtLen1 = BDecLen (b, listBytesDecoded, env);
@@ -8111,7 +7671,7 @@ void ContentInfo::BDecContent (BUF_TYPE b, AsnTag /*tag0*/, AsnLen elmtLen0, Asn
   else
   {
     Asn1Error << "ERROR - SEQUENCE is missing non-optional elmt." << endl;
-    longjmp (env, -185);
+    SnaccExcep::throwMe(-185);
   }
 
   if ((tag1 == MAKE_TAG_ID (CNTX, CONS, 0)))
@@ -8125,7 +7685,7 @@ void ContentInfo::BDecContent (BUF_TYPE b, AsnTag /*tag0*/, AsnLen elmtLen0, Asn
   else
   {
     Asn1Error << "ERROR - SEQUENCE is missing non-optional elmt." << endl;
-    longjmp (env, -186);
+    SnaccExcep::throwMe(-186);
   }
 
   bytesDecoded += seqBytesDecoded;
@@ -8137,7 +7697,7 @@ void ContentInfo::BDecContent (BUF_TYPE b, AsnTag /*tag0*/, AsnLen elmtLen0, Asn
   else if (seqBytesDecoded != elmtLen0)
   {
     Asn1Error << "ERROR - Length discrepancy on sequence." << endl;
-    longjmp (env, -187);
+    SnaccExcep::throwMe(-187);
   }
   else
     return;
@@ -8160,33 +7720,12 @@ void ContentInfo::BDec (BUF_TYPE b, AsnLen &bytesDecoded, ENV_TYPE env)
   if ((tag = BDecTag (b, bytesDecoded, env)) != MAKE_TAG_ID (UNIV, CONS, SEQ_TAG_CODE))
   {
     Asn1Error << "ContentInfo::BDec: ERROR - wrong tag" << endl;
-    longjmp (env, -188);
+    SnaccExcep::throwMe(-188);
   }
   elmtLen1 = BDecLen (b, bytesDecoded, env);
   BDecContent (b, tag, elmtLen1, bytesDecoded, env);
 }
 
-int ContentInfo::BEncPdu (BUF_TYPE b, AsnLen &bytesEncoded)
-{
-    bytesEncoded = BEnc (b);
-    return !b.WriteError();
-}
-
-int ContentInfo::BDecPdu (BUF_TYPE b, AsnLen &bytesDecoded)
-{
-    ENV_TYPE env;
-    int val;
-
-    bytesDecoded = 0;
-    if ((val = setjmp (env)) == 0)
-    {
-         BDec (b, bytesDecoded, env);
-         return !b.ReadError();
-    }
-    else
-        return false;
-}
-
 void ContentInfo::Print (ostream &os) const
 {
 #ifndef NDEBUG
@@ -8377,7 +7916,7 @@ void SignedData::BDecContent (BUF_TYPE b, AsnTag /*tag0*/, AsnLen elmtLen0, AsnL
   else
   {
     Asn1Error << "ERROR - SEQUENCE is missing non-optional elmt." << endl;
-    longjmp (env, -189);
+    SnaccExcep::throwMe(-189);
   }
 
   if ((tag1 == MAKE_TAG_ID (UNIV, CONS, SET_TAG_CODE)))
@@ -8389,7 +7928,7 @@ void SignedData::BDecContent (BUF_TYPE b, AsnTag /*tag0*/, AsnLen elmtLen0, AsnL
   else
   {
     Asn1Error << "ERROR - SEQUENCE is missing non-optional elmt." << endl;
-    longjmp (env, -190);
+    SnaccExcep::throwMe(-190);
   }
 
   if ((tag1 == MAKE_TAG_ID (UNIV, CONS, SEQ_TAG_CODE)))
@@ -8402,7 +7941,7 @@ void SignedData::BDecContent (BUF_TYPE b, AsnTag /*tag0*/, AsnLen elmtLen0, AsnL
   else
   {
     Asn1Error << "ERROR - SEQUENCE is missing non-optional elmt." << endl;
-    longjmp (env, -191);
+    SnaccExcep::throwMe(-191);
   }
 
   if ((tag1 == MAKE_TAG_ID (CNTX, CONS, 0)))
@@ -8429,7 +7968,7 @@ void SignedData::BDecContent (BUF_TYPE b, AsnTag /*tag0*/, AsnLen elmtLen0, AsnL
   else
   {
     Asn1Error << "ERROR - SEQUENCE is missing non-optional elmt." << endl;
-    longjmp (env, -192);
+    SnaccExcep::throwMe(-192);
   }
 
   bytesDecoded += seqBytesDecoded;
@@ -8441,7 +7980,7 @@ void SignedData::BDecContent (BUF_TYPE b, AsnTag /*tag0*/, AsnLen elmtLen0, AsnL
   else if (seqBytesDecoded != elmtLen0)
   {
     Asn1Error << "ERROR - Length discrepancy on sequence." << endl;
-    longjmp (env, -193);
+    SnaccExcep::throwMe(-193);
   }
   else
     return;
@@ -8464,33 +8003,12 @@ void SignedData::BDec (BUF_TYPE b, AsnLen &bytesDecoded, ENV_TYPE env)
   if ((tag = BDecTag (b, bytesDecoded, env)) != MAKE_TAG_ID (UNIV, CONS, SEQ_TAG_CODE))
   {
     Asn1Error << "SignedData::BDec: ERROR - wrong tag" << endl;
-    longjmp (env, -194);
+    SnaccExcep::throwMe(-194);
   }
   elmtLen1 = BDecLen (b, bytesDecoded, env);
   BDecContent (b, tag, elmtLen1, bytesDecoded, env);
 }
 
-int SignedData::BEncPdu (BUF_TYPE b, AsnLen &bytesEncoded)
-{
-    bytesEncoded = BEnc (b);
-    return !b.WriteError();
-}
-
-int SignedData::BDecPdu (BUF_TYPE b, AsnLen &bytesDecoded)
-{
-    ENV_TYPE env;
-    int val;
-
-    bytesDecoded = 0;
-    if ((val = setjmp (env)) == 0)
-    {
-         BDec (b, bytesDecoded, env);
-         return !b.ReadError();
-    }
-    else
-        return false;
-}
-
 void SignedData::Print (ostream &os) const
 {
 #ifndef NDEBUG
@@ -8722,7 +8240,7 @@ void EnvelopedData::BDecContent (BUF_TYPE b, AsnTag /*tag0*/, AsnLen elmtLen0, A
   else
   {
     Asn1Error << "ERROR - SEQUENCE is missing non-optional elmt." << endl;
-    longjmp (env, -195);
+    SnaccExcep::throwMe(-195);
   }
 
   if ((tag1 == MAKE_TAG_ID (CNTX, CONS, 0)))
@@ -8742,7 +8260,7 @@ void EnvelopedData::BDecContent (BUF_TYPE b, AsnTag /*tag0*/, AsnLen elmtLen0, A
   else
   {
     Asn1Error << "ERROR - SEQUENCE is missing non-optional elmt." << endl;
-    longjmp (env, -196);
+    SnaccExcep::throwMe(-196);
   }
 
   if ((tag1 == MAKE_TAG_ID (UNIV, CONS, SEQ_TAG_CODE)))
@@ -8770,7 +8288,7 @@ void EnvelopedData::BDecContent (BUF_TYPE b, AsnTag /*tag0*/, AsnLen elmtLen0, A
   else
   {
     Asn1Error << "ERROR - SEQUENCE is missing non-optional elmt." << endl;
-    longjmp (env, -197);
+    SnaccExcep::throwMe(-197);
   }
 
   if ((tag1 == MAKE_TAG_ID (CNTX, CONS, 1)))
@@ -8789,7 +8307,7 @@ void EnvelopedData::BDecContent (BUF_TYPE b, AsnTag /*tag0*/, AsnLen elmtLen0, A
   else if (seqBytesDecoded != elmtLen0)
   {
     Asn1Error << "ERROR - Length discrepancy on sequence." << endl;
-    longjmp (env, -198);
+    SnaccExcep::throwMe(-198);
   }
   else
     return;
@@ -8812,33 +8330,12 @@ void EnvelopedData::BDec (BUF_TYPE b, AsnLen &bytesDecoded, ENV_TYPE env)
   if ((tag = BDecTag (b, bytesDecoded, env)) != MAKE_TAG_ID (UNIV, CONS, SEQ_TAG_CODE))
   {
     Asn1Error << "EnvelopedData::BDec: ERROR - wrong tag" << endl;
-    longjmp (env, -199);
+    SnaccExcep::throwMe(-199);
   }
   elmtLen1 = BDecLen (b, bytesDecoded, env);
   BDecContent (b, tag, elmtLen1, bytesDecoded, env);
 }
 
-int EnvelopedData::BEncPdu (BUF_TYPE b, AsnLen &bytesEncoded)
-{
-    bytesEncoded = BEnc (b);
-    return !b.WriteError();
-}
-
-int EnvelopedData::BDecPdu (BUF_TYPE b, AsnLen &bytesDecoded)
-{
-    ENV_TYPE env;
-    int val;
-
-    bytesDecoded = 0;
-    if ((val = setjmp (env)) == 0)
-    {
-         BDec (b, bytesDecoded, env);
-         return !b.ReadError();
-    }
-    else
-        return false;
-}
-
 void EnvelopedData::Print (ostream &os) const
 {
 #ifndef NDEBUG
@@ -9042,7 +8539,7 @@ void DigestedData::BDecContent (BUF_TYPE b, AsnTag /*tag0*/, AsnLen elmtLen0, As
   else
   {
     Asn1Error << "ERROR - SEQUENCE is missing non-optional elmt." << endl;
-    longjmp (env, -200);
+    SnaccExcep::throwMe(-200);
   }
 
   if ((tag1 == MAKE_TAG_ID (UNIV, CONS, SEQ_TAG_CODE)))
@@ -9055,7 +8552,7 @@ void DigestedData::BDecContent (BUF_TYPE b, AsnTag /*tag0*/, AsnLen elmtLen0, As
   else
   {
     Asn1Error << "ERROR - SEQUENCE is missing non-optional elmt." << endl;
-    longjmp (env, -201);
+    SnaccExcep::throwMe(-201);
   }
 
   if ((tag1 == MAKE_TAG_ID (UNIV, CONS, SEQ_TAG_CODE)))
@@ -9068,7 +8565,7 @@ void DigestedData::BDecContent (BUF_TYPE b, AsnTag /*tag0*/, AsnLen elmtLen0, As
   else
   {
     Asn1Error << "ERROR - SEQUENCE is missing non-optional elmt." << endl;
-    longjmp (env, -202);
+    SnaccExcep::throwMe(-202);
   }
 
   if ((tag1 == MAKE_TAG_ID (UNIV, PRIM, OCTETSTRING_TAG_CODE))
@@ -9080,7 +8577,7 @@ void DigestedData::BDecContent (BUF_TYPE b, AsnTag /*tag0*/, AsnLen elmtLen0, As
   else
   {
     Asn1Error << "ERROR - SEQUENCE is missing non-optional elmt." << endl;
-    longjmp (env, -203);
+    SnaccExcep::throwMe(-203);
   }
 
   bytesDecoded += seqBytesDecoded;
@@ -9092,7 +8589,7 @@ void DigestedData::BDecContent (BUF_TYPE b, AsnTag /*tag0*/, AsnLen elmtLen0, As
   else if (seqBytesDecoded != elmtLen0)
   {
     Asn1Error << "ERROR - Length discrepancy on sequence." << endl;
-    longjmp (env, -204);
+    SnaccExcep::throwMe(-204);
   }
   else
     return;
@@ -9115,33 +8612,12 @@ void DigestedData::BDec (BUF_TYPE b, AsnLen &bytesDecoded, ENV_TYPE env)
   if ((tag = BDecTag (b, bytesDecoded, env)) != MAKE_TAG_ID (UNIV, CONS, SEQ_TAG_CODE))
   {
     Asn1Error << "DigestedData::BDec: ERROR - wrong tag" << endl;
-    longjmp (env, -205);
+    SnaccExcep::throwMe(-205);
   }
   elmtLen1 = BDecLen (b, bytesDecoded, env);
   BDecContent (b, tag, elmtLen1, bytesDecoded, env);
 }
 
-int DigestedData::BEncPdu (BUF_TYPE b, AsnLen &bytesEncoded)
-{
-    bytesEncoded = BEnc (b);
-    return !b.WriteError();
-}
-
-int DigestedData::BDecPdu (BUF_TYPE b, AsnLen &bytesDecoded)
-{
-    ENV_TYPE env;
-    int val;
-
-    bytesDecoded = 0;
-    if ((val = setjmp (env)) == 0)
-    {
-         BDec (b, bytesDecoded, env);
-         return !b.ReadError();
-    }
-    else
-        return false;
-}
-
 void DigestedData::Print (ostream &os) const
 {
 #ifndef NDEBUG
@@ -9298,7 +8774,7 @@ void EncryptedData::BDecContent (BUF_TYPE b, AsnTag /*tag0*/, AsnLen elmtLen0, A
   else
   {
     Asn1Error << "ERROR - SEQUENCE is missing non-optional elmt." << endl;
-    longjmp (env, -206);
+    SnaccExcep::throwMe(-206);
   }
 
   if ((tag1 == MAKE_TAG_ID (UNIV, CONS, SEQ_TAG_CODE)))
@@ -9310,7 +8786,7 @@ void EncryptedData::BDecContent (BUF_TYPE b, AsnTag /*tag0*/, AsnLen elmtLen0, A
   else
   {
     Asn1Error << "ERROR - SEQUENCE is missing non-optional elmt." << endl;
-    longjmp (env, -207);
+    SnaccExcep::throwMe(-207);
   }
 
   bytesDecoded += seqBytesDecoded;
@@ -9322,7 +8798,7 @@ void EncryptedData::BDecContent (BUF_TYPE b, AsnTag /*tag0*/, AsnLen elmtLen0, A
   else if (seqBytesDecoded != elmtLen0)
   {
     Asn1Error << "ERROR - Length discrepancy on sequence." << endl;
-    longjmp (env, -208);
+    SnaccExcep::throwMe(-208);
   }
   else
     return;
@@ -9345,33 +8821,12 @@ void EncryptedData::BDec (BUF_TYPE b, AsnLen &bytesDecoded, ENV_TYPE env)
   if ((tag = BDecTag (b, bytesDecoded, env)) != MAKE_TAG_ID (UNIV, CONS, SEQ_TAG_CODE))
   {
     Asn1Error << "EncryptedData::BDec: ERROR - wrong tag" << endl;
-    longjmp (env, -209);
+    SnaccExcep::throwMe(-209);
   }
   elmtLen1 = BDecLen (b, bytesDecoded, env);
   BDecContent (b, tag, elmtLen1, bytesDecoded, env);
 }
 
-int EncryptedData::BEncPdu (BUF_TYPE b, AsnLen &bytesEncoded)
-{
-    bytesEncoded = BEnc (b);
-    return !b.WriteError();
-}
-
-int EncryptedData::BDecPdu (BUF_TYPE b, AsnLen &bytesDecoded)
-{
-    ENV_TYPE env;
-    int val;
-
-    bytesDecoded = 0;
-    if ((val = setjmp (env)) == 0)
-    {
-         BDec (b, bytesDecoded, env);
-         return !b.ReadError();
-    }
-    else
-        return false;
-}
-
 void EncryptedData::Print (ostream &os) const
 {
 #ifndef NDEBUG
@@ -9639,7 +9094,7 @@ void AuthenticatedData::BDecContent (BUF_TYPE b, AsnTag /*tag0*/, AsnLen elmtLen
   else
   {
     Asn1Error << "ERROR - SEQUENCE is missing non-optional elmt." << endl;
-    longjmp (env, -210);
+    SnaccExcep::throwMe(-210);
   }
 
   if ((tag1 == MAKE_TAG_ID (CNTX, CONS, 0)))
@@ -9659,7 +9114,7 @@ void AuthenticatedData::BDecContent (BUF_TYPE b, AsnTag /*tag0*/, AsnLen elmtLen
   else
   {
     Asn1Error << "ERROR - SEQUENCE is missing non-optional elmt." << endl;
-    longjmp (env, -211);
+    SnaccExcep::throwMe(-211);
   }
 
   if ((tag1 == MAKE_TAG_ID (UNIV, CONS, SEQ_TAG_CODE)))
@@ -9672,7 +9127,7 @@ void AuthenticatedData::BDecContent (BUF_TYPE b, AsnTag /*tag0*/, AsnLen elmtLen
   else
   {
     Asn1Error << "ERROR - SEQUENCE is missing non-optional elmt." << endl;
-    longjmp (env, -212);
+    SnaccExcep::throwMe(-212);
   }
 
   if ((tag1 == MAKE_TAG_ID (CNTX, CONS, 1)))
@@ -9693,7 +9148,7 @@ void AuthenticatedData::BDecContent (BUF_TYPE b, AsnTag /*tag0*/, AsnLen elmtLen
   else
   {
     Asn1Error << "ERROR - SEQUENCE is missing non-optional elmt." << endl;
-    longjmp (env, -213);
+    SnaccExcep::throwMe(-213);
   }
 
   if ((tag1 == MAKE_TAG_ID (CNTX, CONS, 2)))
@@ -9729,7 +9184,7 @@ void AuthenticatedData::BDecContent (BUF_TYPE b, AsnTag /*tag0*/, AsnLen elmtLen
   else
   {
     Asn1Error << "ERROR - SEQUENCE is missing non-optional elmt." << endl;
-    longjmp (env, -214);
+    SnaccExcep::throwMe(-214);
   }
 
   if ((tag1 == MAKE_TAG_ID (CNTX, CONS, 3)))
@@ -9748,7 +9203,7 @@ void AuthenticatedData::BDecContent (BUF_TYPE b, AsnTag /*tag0*/, AsnLen elmtLen
   else if (seqBytesDecoded != elmtLen0)
   {
     Asn1Error << "ERROR - Length discrepancy on sequence." << endl;
-    longjmp (env, -215);
+    SnaccExcep::throwMe(-215);
   }
   else
     return;
@@ -9771,33 +9226,12 @@ void AuthenticatedData::BDec (BUF_TYPE b, AsnLen &bytesDecoded, ENV_TYPE env)
   if ((tag = BDecTag (b, bytesDecoded, env)) != MAKE_TAG_ID (UNIV, CONS, SEQ_TAG_CODE))
   {
     Asn1Error << "AuthenticatedData::BDec: ERROR - wrong tag" << endl;
-    longjmp (env, -216);
+    SnaccExcep::throwMe(-216);
   }
   elmtLen1 = BDecLen (b, bytesDecoded, env);
   BDecContent (b, tag, elmtLen1, bytesDecoded, env);
 }
 
-int AuthenticatedData::BEncPdu (BUF_TYPE b, AsnLen &bytesEncoded)
-{
-    bytesEncoded = BEnc (b);
-    return !b.WriteError();
-}
-
-int AuthenticatedData::BDecPdu (BUF_TYPE b, AsnLen &bytesDecoded)
-{
-    ENV_TYPE env;
-    int val;
-
-    bytesDecoded = 0;
-    if ((val = setjmp (env)) == 0)
-    {
-         BDec (b, bytesDecoded, env);
-         return !b.ReadError();
-    }
-    else
-        return false;
-}
-
 void AuthenticatedData::Print (ostream &os) const
 {
 #ifndef NDEBUG
@@ -9945,7 +9379,7 @@ void UserKeyingMaterials::BDec (BUF_TYPE b, AsnLen &bytesDecoded, ENV_TYPE env)
   if ((tag = BDecTag (b, bytesDecoded, env)) != MAKE_TAG_ID (UNIV, CONS, SET_TAG_CODE))
   {
     Asn1Error << "UserKeyingMaterials::BDec: ERROR - wrong tag" << endl;
-    longjmp (env, -217);
+    SnaccExcep::throwMe(-217);
   }
   elmtLen1 = BDecLen (b, bytesDecoded, env);
   BDecContent (b, tag, elmtLen1, bytesDecoded, env);
@@ -10361,7 +9795,7 @@ void  UserKeyingMaterials::BDecContent (BUF_TYPE b, AsnTag /*tag0*/, AsnLen elmt
          && (tag1 != MAKE_TAG_ID (UNIV, CONS, OCTETSTRING_TAG_CODE)))
         {
             Asn1Error << "Unexpected Tag" << endl;
-            longjmp (env, -218);
+            SnaccExcep::throwMe(-218);
         }
 
         elmtLen1 = BDecLen (b, listBytesDecoded, env);
@@ -10457,7 +9891,7 @@ void RC2CBCParameter::BDecContent (BUF_TYPE b, AsnTag /*tag0*/, AsnLen elmtLen0,
   else
   {
     Asn1Error << "ERROR - SEQUENCE is missing non-optional elmt." << endl;
-    longjmp (env, -219);
+    SnaccExcep::throwMe(-219);
   }
 
   if ((tag1 == MAKE_TAG_ID (UNIV, PRIM, OCTETSTRING_TAG_CODE))
@@ -10469,7 +9903,7 @@ void RC2CBCParameter::BDecContent (BUF_TYPE b, AsnTag /*tag0*/, AsnLen elmtLen0,
   else
   {
     Asn1Error << "ERROR - SEQUENCE is missing non-optional elmt." << endl;
-    longjmp (env, -220);
+    SnaccExcep::throwMe(-220);
   }
 
   bytesDecoded += seqBytesDecoded;
@@ -10481,7 +9915,7 @@ void RC2CBCParameter::BDecContent (BUF_TYPE b, AsnTag /*tag0*/, AsnLen elmtLen0,
   else if (seqBytesDecoded != elmtLen0)
   {
     Asn1Error << "ERROR - Length discrepancy on sequence." << endl;
-    longjmp (env, -221);
+    SnaccExcep::throwMe(-221);
   }
   else
     return;
@@ -10504,33 +9938,12 @@ void RC2CBCParameter::BDec (BUF_TYPE b, AsnLen &bytesDecoded, ENV_TYPE env)
   if ((tag = BDecTag (b, bytesDecoded, env)) != MAKE_TAG_ID (UNIV, CONS, SEQ_TAG_CODE))
   {
     Asn1Error << "RC2CBCParameter::BDec: ERROR - wrong tag" << endl;
-    longjmp (env, -222);
+    SnaccExcep::throwMe(-222);
   }
   elmtLen1 = BDecLen (b, bytesDecoded, env);
   BDecContent (b, tag, elmtLen1, bytesDecoded, env);
 }
 
-int RC2CBCParameter::BEncPdu (BUF_TYPE b, AsnLen &bytesEncoded)
-{
-    bytesEncoded = BEnc (b);
-    return !b.WriteError();
-}
-
-int RC2CBCParameter::BDecPdu (BUF_TYPE b, AsnLen &bytesDecoded)
-{
-    ENV_TYPE env;
-    int val;
-
-    bytesDecoded = 0;
-    if ((val = setjmp (env)) == 0)
-    {
-         BDec (b, bytesDecoded, env);
-         return !b.ReadError();
-    }
-    else
-        return false;
-}
-
 void RC2CBCParameter::Print (ostream &os) const
 {
 #ifndef NDEBUG
@@ -10681,7 +10094,7 @@ void ExtendedCertificateOrCertificate::BDecContent (BUF_TYPE b, AsnTag tag, AsnL
 
     default:
       Asn1Error << "ERROR - unexpected tag in CHOICE" << endl;
-      longjmp (env, -223);
+      SnaccExcep::throwMe(-223);
       break;
   } // end switch
 } // ExtendedCertificateOrCertificate::BDecContent
@@ -10706,27 +10119,6 @@ void ExtendedCertificateOrCertificate::BDec (BUF_TYPE b, AsnLen &bytesDecoded, E
     BDecContent (b, tag, elmtLen, bytesDecoded, env);
 }
 
-int ExtendedCertificateOrCertificate::BEncPdu (BUF_TYPE b, AsnLen &bytesEncoded)
-{
-    bytesEncoded = BEnc (b);
-    return !b.WriteError();
-}
-
-int ExtendedCertificateOrCertificate::BDecPdu (BUF_TYPE b, AsnLen &bytesDecoded)
-{
-    ENV_TYPE env;
-    int val;
-
-    bytesDecoded = 0;
-    if ((val = setjmp (env)) == 0)
-    {
-         BDec (b, bytesDecoded, env);
-         return !b.ReadError();
-    }
-    else
-        return false;
-}
-
 void ExtendedCertificateOrCertificate::Print (ostream &os) const
 {
 #ifndef NDEBUG
@@ -10853,7 +10245,7 @@ void DigestInfo::BDecContent (BUF_TYPE b, AsnTag /*tag0*/, AsnLen elmtLen0, AsnL
   else
   {
     Asn1Error << "ERROR - SEQUENCE is missing non-optional elmt." << endl;
-    longjmp (env, -224);
+    SnaccExcep::throwMe(-224);
   }
 
   if ((tag1 == MAKE_TAG_ID (UNIV, PRIM, OCTETSTRING_TAG_CODE))
@@ -10865,7 +10257,7 @@ void DigestInfo::BDecContent (BUF_TYPE b, AsnTag /*tag0*/, AsnLen elmtLen0, AsnL
   else
   {
     Asn1Error << "ERROR - SEQUENCE is missing non-optional elmt." << endl;
-    longjmp (env, -225);
+    SnaccExcep::throwMe(-225);
   }
 
   bytesDecoded += seqBytesDecoded;
@@ -10877,7 +10269,7 @@ void DigestInfo::BDecContent (BUF_TYPE b, AsnTag /*tag0*/, AsnLen elmtLen0, AsnL
   else if (seqBytesDecoded != elmtLen0)
   {
     Asn1Error << "ERROR - Length discrepancy on sequence." << endl;
-    longjmp (env, -226);
+    SnaccExcep::throwMe(-226);
   }
   else
     return;
@@ -10900,33 +10292,12 @@ void DigestInfo::BDec (BUF_TYPE b, AsnLen &bytesDecoded, ENV_TYPE env)
   if ((tag = BDecTag (b, bytesDecoded, env)) != MAKE_TAG_ID (UNIV, CONS, SEQ_TAG_CODE))
   {
     Asn1Error << "DigestInfo::BDec: ERROR - wrong tag" << endl;
-    longjmp (env, -227);
+    SnaccExcep::throwMe(-227);
   }
   elmtLen1 = BDecLen (b, bytesDecoded, env);
   BDecContent (b, tag, elmtLen1, bytesDecoded, env);
 }
 
-int DigestInfo::BEncPdu (BUF_TYPE b, AsnLen &bytesEncoded)
-{
-    bytesEncoded = BEnc (b);
-    return !b.WriteError();
-}
-
-int DigestInfo::BDecPdu (BUF_TYPE b, AsnLen &bytesDecoded)
-{
-    ENV_TYPE env;
-    int val;
-
-    bytesDecoded = 0;
-    if ((val = setjmp (env)) == 0)
-    {
-         BDec (b, bytesDecoded, env);
-         return !b.ReadError();
-    }
-    else
-        return false;
-}
-
 void DigestInfo::Print (ostream &os) const
 {
 #ifndef NDEBUG