diff options
author | Peter Dettman <peter.dettman@bouncycastle.org> | 2015-11-21 23:40:59 +0700 |
---|---|---|
committer | Peter Dettman <peter.dettman@bouncycastle.org> | 2015-11-21 23:40:59 +0700 |
commit | 6a939bee94f82fb515144304e81ddbb44c36eda4 (patch) | |
tree | 5ee407d9380b9afdd77c0528f2f5445a83977a94 /crypto/src | |
parent | Factor out IsEnumType method (diff) | |
download | BouncyCastle.NET-ed25519-6a939bee94f82fb515144304e81ddbb44c36eda4.tar.xz |
Add Platform method for getting the type name of an object
Diffstat (limited to 'crypto/src')
252 files changed, 559 insertions, 333 deletions
diff --git a/crypto/src/asn1/Asn1OctetString.cs b/crypto/src/asn1/Asn1OctetString.cs index 9c738a8f2..73b6e51bf 100644 --- a/crypto/src/asn1/Asn1OctetString.cs +++ b/crypto/src/asn1/Asn1OctetString.cs @@ -52,7 +52,7 @@ namespace Org.BouncyCastle.Asn1 if (obj is Asn1TaggedObject) return GetInstance(((Asn1TaggedObject)obj).GetObject()); - throw new ArgumentException("illegal object in GetInstance: " + obj.GetType().Name); + throw new ArgumentException("illegal object in GetInstance: " + Platform.GetTypeName(obj)); } /** diff --git a/crypto/src/asn1/Asn1Sequence.cs b/crypto/src/asn1/Asn1Sequence.cs index 5f9ea4460..849f5e308 100644 --- a/crypto/src/asn1/Asn1Sequence.cs +++ b/crypto/src/asn1/Asn1Sequence.cs @@ -50,7 +50,7 @@ namespace Org.BouncyCastle.Asn1 } } - throw new ArgumentException("Unknown object in GetInstance: " + obj.GetType().FullName, "obj"); + throw new ArgumentException("Unknown object in GetInstance: " + Platform.GetTypeName(obj), "obj"); } /** @@ -103,7 +103,7 @@ namespace Org.BouncyCastle.Asn1 return (Asn1Sequence) inner; } - throw new ArgumentException("Unknown object in GetInstance: " + obj.GetType().FullName, "obj"); + throw new ArgumentException("Unknown object in GetInstance: " + Platform.GetTypeName(obj), "obj"); } protected internal Asn1Sequence( diff --git a/crypto/src/asn1/Asn1Set.cs b/crypto/src/asn1/Asn1Set.cs index 18f8020f2..bf83dbdc1 100644 --- a/crypto/src/asn1/Asn1Set.cs +++ b/crypto/src/asn1/Asn1Set.cs @@ -55,7 +55,7 @@ namespace Org.BouncyCastle.Asn1 } } - throw new ArgumentException("Unknown object in GetInstance: " + obj.GetType().FullName, "obj"); + throw new ArgumentException("Unknown object in GetInstance: " + Platform.GetTypeName(obj), "obj"); } /** @@ -121,7 +121,7 @@ namespace Org.BouncyCastle.Asn1 return new DerSet(v, false); } - throw new ArgumentException("Unknown object in GetInstance: " + obj.GetType().FullName, "obj"); + throw new ArgumentException("Unknown object in GetInstance: " + Platform.GetTypeName(obj), "obj"); } protected internal Asn1Set( diff --git a/crypto/src/asn1/Asn1TaggedObject.cs b/crypto/src/asn1/Asn1TaggedObject.cs index 2e480738a..fdf5b651a 100644 --- a/crypto/src/asn1/Asn1TaggedObject.cs +++ b/crypto/src/asn1/Asn1TaggedObject.cs @@ -37,7 +37,7 @@ namespace Org.BouncyCastle.Asn1 return (Asn1TaggedObject) obj; } - throw new ArgumentException("Unknown object in GetInstance: " + obj.GetType().FullName, "obj"); + throw new ArgumentException("Unknown object in GetInstance: " + Platform.GetTypeName(obj), "obj"); } /** diff --git a/crypto/src/asn1/BerTaggedObject.cs b/crypto/src/asn1/BerTaggedObject.cs index 228b136cb..fd0bdc285 100644 --- a/crypto/src/asn1/BerTaggedObject.cs +++ b/crypto/src/asn1/BerTaggedObject.cs @@ -82,7 +82,7 @@ namespace Org.BouncyCastle.Asn1 } else { - throw Platform.CreateNotImplementedException(obj.GetType().Name); + throw Platform.CreateNotImplementedException(Platform.GetTypeName(obj)); } foreach (Asn1Encodable o in eObj) diff --git a/crypto/src/asn1/DerBMPString.cs b/crypto/src/asn1/DerBMPString.cs index 4f7e0a635..33d950ff8 100644 --- a/crypto/src/asn1/DerBMPString.cs +++ b/crypto/src/asn1/DerBMPString.cs @@ -1,5 +1,7 @@ using System; +using Org.BouncyCastle.Utilities; + namespace Org.BouncyCastle.Asn1 { /** @@ -24,7 +26,7 @@ namespace Org.BouncyCastle.Asn1 return (DerBmpString)obj; } - throw new ArgumentException("illegal object in GetInstance: " + obj.GetType().Name); + throw new ArgumentException("illegal object in GetInstance: " + Platform.GetTypeName(obj)); } /** diff --git a/crypto/src/asn1/DerBitString.cs b/crypto/src/asn1/DerBitString.cs index fa37e6c0c..a3c2cee01 100644 --- a/crypto/src/asn1/DerBitString.cs +++ b/crypto/src/asn1/DerBitString.cs @@ -29,7 +29,7 @@ namespace Org.BouncyCastle.Asn1 return (DerBitString) obj; } - throw new ArgumentException("illegal object in GetInstance: " + obj.GetType().Name); + throw new ArgumentException("illegal object in GetInstance: " + Platform.GetTypeName(obj)); } /** diff --git a/crypto/src/asn1/DerBoolean.cs b/crypto/src/asn1/DerBoolean.cs index 66791d16c..709f4ddce 100644 --- a/crypto/src/asn1/DerBoolean.cs +++ b/crypto/src/asn1/DerBoolean.cs @@ -1,5 +1,7 @@ using System; +using Org.BouncyCastle.Utilities; + namespace Org.BouncyCastle.Asn1 { public class DerBoolean @@ -23,7 +25,7 @@ namespace Org.BouncyCastle.Asn1 return (DerBoolean) obj; } - throw new ArgumentException("illegal object in GetInstance: " + obj.GetType().Name); + throw new ArgumentException("illegal object in GetInstance: " + Platform.GetTypeName(obj)); } /** diff --git a/crypto/src/asn1/DerEnumerated.cs b/crypto/src/asn1/DerEnumerated.cs index 2638b0205..476b7fa9a 100644 --- a/crypto/src/asn1/DerEnumerated.cs +++ b/crypto/src/asn1/DerEnumerated.cs @@ -23,7 +23,7 @@ namespace Org.BouncyCastle.Asn1 return (DerEnumerated)obj; } - throw new ArgumentException("illegal object in GetInstance: " + obj.GetType().Name); + throw new ArgumentException("illegal object in GetInstance: " + Platform.GetTypeName(obj)); } /** diff --git a/crypto/src/asn1/DerGeneralString.cs b/crypto/src/asn1/DerGeneralString.cs index 0e20b53bd..553b0e09c 100644 --- a/crypto/src/asn1/DerGeneralString.cs +++ b/crypto/src/asn1/DerGeneralString.cs @@ -19,7 +19,7 @@ namespace Org.BouncyCastle.Asn1 } throw new ArgumentException("illegal object in GetInstance: " - + obj.GetType().Name); + + Platform.GetTypeName(obj)); } public static DerGeneralString GetInstance( diff --git a/crypto/src/asn1/DerGeneralizedTime.cs b/crypto/src/asn1/DerGeneralizedTime.cs index 79b008768..b224ebe42 100644 --- a/crypto/src/asn1/DerGeneralizedTime.cs +++ b/crypto/src/asn1/DerGeneralizedTime.cs @@ -27,7 +27,7 @@ namespace Org.BouncyCastle.Asn1 return (DerGeneralizedTime)obj; } - throw new ArgumentException("illegal object in GetInstance: " + obj.GetType().Name, "obj"); + throw new ArgumentException("illegal object in GetInstance: " + Platform.GetTypeName(obj), "obj"); } /** diff --git a/crypto/src/asn1/DerIA5String.cs b/crypto/src/asn1/DerIA5String.cs index 9fa2cba3c..63e91582e 100644 --- a/crypto/src/asn1/DerIA5String.cs +++ b/crypto/src/asn1/DerIA5String.cs @@ -26,7 +26,7 @@ namespace Org.BouncyCastle.Asn1 return (DerIA5String)obj; } - throw new ArgumentException("illegal object in GetInstance: " + obj.GetType().Name); + throw new ArgumentException("illegal object in GetInstance: " + Platform.GetTypeName(obj)); } /** diff --git a/crypto/src/asn1/DerInteger.cs b/crypto/src/asn1/DerInteger.cs index eb0614515..3610de588 100644 --- a/crypto/src/asn1/DerInteger.cs +++ b/crypto/src/asn1/DerInteger.cs @@ -23,7 +23,7 @@ namespace Org.BouncyCastle.Asn1 return (DerInteger)obj; } - throw new ArgumentException("illegal object in GetInstance: " + obj.GetType().Name); + throw new ArgumentException("illegal object in GetInstance: " + Platform.GetTypeName(obj)); } /** diff --git a/crypto/src/asn1/DerNumericString.cs b/crypto/src/asn1/DerNumericString.cs index 6e2715a4d..a729f9e8e 100644 --- a/crypto/src/asn1/DerNumericString.cs +++ b/crypto/src/asn1/DerNumericString.cs @@ -26,7 +26,7 @@ namespace Org.BouncyCastle.Asn1 return (DerNumericString)obj; } - throw new ArgumentException("illegal object in GetInstance: " + obj.GetType().Name); + throw new ArgumentException("illegal object in GetInstance: " + Platform.GetTypeName(obj)); } /** diff --git a/crypto/src/asn1/DerObjectIdentifier.cs b/crypto/src/asn1/DerObjectIdentifier.cs index 563c637e5..6ac2b7e9e 100644 --- a/crypto/src/asn1/DerObjectIdentifier.cs +++ b/crypto/src/asn1/DerObjectIdentifier.cs @@ -26,7 +26,7 @@ namespace Org.BouncyCastle.Asn1 return (DerObjectIdentifier) obj; if (obj is byte[]) return FromOctetString((byte[])obj); - throw new ArgumentException("illegal object in GetInstance: " + obj.GetType().Name, "obj"); + throw new ArgumentException("illegal object in GetInstance: " + Platform.GetTypeName(obj), "obj"); } /** diff --git a/crypto/src/asn1/DerPrintableString.cs b/crypto/src/asn1/DerPrintableString.cs index cd2f46b48..e1797346d 100644 --- a/crypto/src/asn1/DerPrintableString.cs +++ b/crypto/src/asn1/DerPrintableString.cs @@ -26,7 +26,7 @@ namespace Org.BouncyCastle.Asn1 return (DerPrintableString)obj; } - throw new ArgumentException("illegal object in GetInstance: " + obj.GetType().Name); + throw new ArgumentException("illegal object in GetInstance: " + Platform.GetTypeName(obj)); } /** diff --git a/crypto/src/asn1/DerT61String.cs b/crypto/src/asn1/DerT61String.cs index 4dee6f30c..746ccfe70 100644 --- a/crypto/src/asn1/DerT61String.cs +++ b/crypto/src/asn1/DerT61String.cs @@ -25,7 +25,7 @@ namespace Org.BouncyCastle.Asn1 return (DerT61String)obj; } - throw new ArgumentException("illegal object in GetInstance: " + obj.GetType().Name); + throw new ArgumentException("illegal object in GetInstance: " + Platform.GetTypeName(obj)); } /** diff --git a/crypto/src/asn1/DerUTCTime.cs b/crypto/src/asn1/DerUTCTime.cs index 639a2d4f4..99af8bf6b 100644 --- a/crypto/src/asn1/DerUTCTime.cs +++ b/crypto/src/asn1/DerUTCTime.cs @@ -27,7 +27,7 @@ namespace Org.BouncyCastle.Asn1 return (DerUtcTime)obj; } - throw new ArgumentException("illegal object in GetInstance: " + obj.GetType().Name); + throw new ArgumentException("illegal object in GetInstance: " + Platform.GetTypeName(obj)); } /** diff --git a/crypto/src/asn1/DerUTF8String.cs b/crypto/src/asn1/DerUTF8String.cs index 92a50e824..758a5068d 100644 --- a/crypto/src/asn1/DerUTF8String.cs +++ b/crypto/src/asn1/DerUTF8String.cs @@ -1,6 +1,8 @@ using System; using System.Text; +using Org.BouncyCastle.Utilities; + namespace Org.BouncyCastle.Asn1 { /** @@ -24,7 +26,7 @@ namespace Org.BouncyCastle.Asn1 return (DerUtf8String)obj; } - throw new ArgumentException("illegal object in GetInstance: " + obj.GetType().Name); + throw new ArgumentException("illegal object in GetInstance: " + Platform.GetTypeName(obj)); } /** diff --git a/crypto/src/asn1/DerUniversalString.cs b/crypto/src/asn1/DerUniversalString.cs index 305102f2f..284d0f8c5 100644 --- a/crypto/src/asn1/DerUniversalString.cs +++ b/crypto/src/asn1/DerUniversalString.cs @@ -28,7 +28,7 @@ namespace Org.BouncyCastle.Asn1 return (DerUniversalString)obj; } - throw new ArgumentException("illegal object in GetInstance: " + obj.GetType().Name); + throw new ArgumentException("illegal object in GetInstance: " + Platform.GetTypeName(obj)); } /** diff --git a/crypto/src/asn1/DerVisibleString.cs b/crypto/src/asn1/DerVisibleString.cs index 84c9caade..e1112201a 100644 --- a/crypto/src/asn1/DerVisibleString.cs +++ b/crypto/src/asn1/DerVisibleString.cs @@ -36,7 +36,7 @@ namespace Org.BouncyCastle.Asn1 return GetInstance(((Asn1TaggedObject)obj).GetObject()); } - throw new ArgumentException("illegal object in GetInstance: " + obj.GetType().Name); + throw new ArgumentException("illegal object in GetInstance: " + Platform.GetTypeName(obj)); } /** diff --git a/crypto/src/asn1/cmp/CAKeyUpdAnnContent.cs b/crypto/src/asn1/cmp/CAKeyUpdAnnContent.cs index 3cdb128a6..b74bac87a 100644 --- a/crypto/src/asn1/cmp/CAKeyUpdAnnContent.cs +++ b/crypto/src/asn1/cmp/CAKeyUpdAnnContent.cs @@ -1,5 +1,7 @@ using System; +using Org.BouncyCastle.Utilities; + namespace Org.BouncyCastle.Asn1.Cmp { public class CAKeyUpdAnnContent @@ -24,7 +26,7 @@ namespace Org.BouncyCastle.Asn1.Cmp if (obj is Asn1Sequence) return new CAKeyUpdAnnContent((Asn1Sequence)obj); - throw new ArgumentException("Invalid object: " + obj.GetType().Name, "obj"); + throw new ArgumentException("Invalid object: " + Platform.GetTypeName(obj), "obj"); } public virtual CmpCertificate OldWithNew diff --git a/crypto/src/asn1/cmp/CertConfirmContent.cs b/crypto/src/asn1/cmp/CertConfirmContent.cs index f4016d8d8..370a9e7d6 100644 --- a/crypto/src/asn1/cmp/CertConfirmContent.cs +++ b/crypto/src/asn1/cmp/CertConfirmContent.cs @@ -1,5 +1,7 @@ using System; +using Org.BouncyCastle.Utilities; + namespace Org.BouncyCastle.Asn1.Cmp { public class CertConfirmContent @@ -20,7 +22,7 @@ namespace Org.BouncyCastle.Asn1.Cmp if (obj is Asn1Sequence) return new CertConfirmContent((Asn1Sequence)obj); - throw new ArgumentException("Invalid object: " + obj.GetType().Name, "obj"); + throw new ArgumentException("Invalid object: " + Platform.GetTypeName(obj), "obj"); } public virtual CertStatus[] ToCertStatusArray() diff --git a/crypto/src/asn1/cmp/CertOrEncCert.cs b/crypto/src/asn1/cmp/CertOrEncCert.cs index 4c049c180..eb200e1e8 100644 --- a/crypto/src/asn1/cmp/CertOrEncCert.cs +++ b/crypto/src/asn1/cmp/CertOrEncCert.cs @@ -1,6 +1,7 @@ using System; using Org.BouncyCastle.Asn1.Crmf; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Asn1.Cmp { @@ -34,7 +35,7 @@ namespace Org.BouncyCastle.Asn1.Cmp if (obj is Asn1TaggedObject) return new CertOrEncCert((Asn1TaggedObject)obj); - throw new ArgumentException("Invalid object: " + obj.GetType().Name, "obj"); + throw new ArgumentException("Invalid object: " + Platform.GetTypeName(obj), "obj"); } public CertOrEncCert(CmpCertificate certificate) diff --git a/crypto/src/asn1/cmp/CertRepMessage.cs b/crypto/src/asn1/cmp/CertRepMessage.cs index c22b079c8..82869784d 100644 --- a/crypto/src/asn1/cmp/CertRepMessage.cs +++ b/crypto/src/asn1/cmp/CertRepMessage.cs @@ -1,5 +1,7 @@ using System; +using Org.BouncyCastle.Utilities; + namespace Org.BouncyCastle.Asn1.Cmp { public class CertRepMessage @@ -28,7 +30,7 @@ namespace Org.BouncyCastle.Asn1.Cmp if (obj is Asn1Sequence) return new CertRepMessage((Asn1Sequence)obj); - throw new ArgumentException("Invalid object: " + obj.GetType().Name, "obj"); + throw new ArgumentException("Invalid object: " + Platform.GetTypeName(obj), "obj"); } public CertRepMessage(CmpCertificate[] caPubs, CertResponse[] response) diff --git a/crypto/src/asn1/cmp/CertResponse.cs b/crypto/src/asn1/cmp/CertResponse.cs index 80813b8b7..843fd9299 100644 --- a/crypto/src/asn1/cmp/CertResponse.cs +++ b/crypto/src/asn1/cmp/CertResponse.cs @@ -1,5 +1,7 @@ using System; +using Org.BouncyCastle.Utilities; + namespace Org.BouncyCastle.Asn1.Cmp { public class CertResponse @@ -45,7 +47,7 @@ namespace Org.BouncyCastle.Asn1.Cmp if (obj is Asn1Sequence) return new CertResponse((Asn1Sequence)obj); - throw new ArgumentException("Invalid object: " + obj.GetType().Name, "obj"); + throw new ArgumentException("Invalid object: " + Platform.GetTypeName(obj), "obj"); } public CertResponse( diff --git a/crypto/src/asn1/cmp/CertStatus.cs b/crypto/src/asn1/cmp/CertStatus.cs index 52d5ac504..d437b57b2 100644 --- a/crypto/src/asn1/cmp/CertStatus.cs +++ b/crypto/src/asn1/cmp/CertStatus.cs @@ -1,6 +1,7 @@ using System; using Org.BouncyCastle.Math; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Asn1.Cmp { @@ -43,7 +44,7 @@ namespace Org.BouncyCastle.Asn1.Cmp if (obj is Asn1Sequence) return new CertStatus((Asn1Sequence)obj); - throw new ArgumentException("Invalid object: " + obj.GetType().Name, "obj"); + throw new ArgumentException("Invalid object: " + Platform.GetTypeName(obj), "obj"); } public virtual Asn1OctetString CertHash diff --git a/crypto/src/asn1/cmp/CertifiedKeyPair.cs b/crypto/src/asn1/cmp/CertifiedKeyPair.cs index 655dde0c5..c06f00019 100644 --- a/crypto/src/asn1/cmp/CertifiedKeyPair.cs +++ b/crypto/src/asn1/cmp/CertifiedKeyPair.cs @@ -1,6 +1,7 @@ using System; using Org.BouncyCastle.Asn1.Crmf; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Asn1.Cmp { @@ -45,7 +46,7 @@ namespace Org.BouncyCastle.Asn1.Cmp if (obj is Asn1Sequence) return new CertifiedKeyPair((Asn1Sequence)obj); - throw new ArgumentException("Invalid object: " + obj.GetType().Name, "obj"); + throw new ArgumentException("Invalid object: " + Platform.GetTypeName(obj), "obj"); } public CertifiedKeyPair( diff --git a/crypto/src/asn1/cmp/Challenge.cs b/crypto/src/asn1/cmp/Challenge.cs index bee5f96f5..5c78c2a2b 100644 --- a/crypto/src/asn1/cmp/Challenge.cs +++ b/crypto/src/asn1/cmp/Challenge.cs @@ -1,6 +1,7 @@ using System; using Org.BouncyCastle.Asn1.X509; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Asn1.Cmp { @@ -32,7 +33,7 @@ namespace Org.BouncyCastle.Asn1.Cmp if (obj is Asn1Sequence) return new Challenge((Asn1Sequence)obj); - throw new ArgumentException("Invalid object: " + obj.GetType().Name, "obj"); + throw new ArgumentException("Invalid object: " + Platform.GetTypeName(obj), "obj"); } public virtual AlgorithmIdentifier Owf diff --git a/crypto/src/asn1/cmp/CmpCertificate.cs b/crypto/src/asn1/cmp/CmpCertificate.cs index 16ee30059..33356b486 100644 --- a/crypto/src/asn1/cmp/CmpCertificate.cs +++ b/crypto/src/asn1/cmp/CmpCertificate.cs @@ -1,6 +1,7 @@ using System; using Org.BouncyCastle.Asn1.X509; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Asn1.Cmp { @@ -37,7 +38,7 @@ namespace Org.BouncyCastle.Asn1.Cmp if (obj is Asn1TaggedObject) return new CmpCertificate(AttributeCertificate.GetInstance(((Asn1TaggedObject)obj).GetObject())); - throw new ArgumentException("Invalid object: " + obj.GetType().Name, "obj"); + throw new ArgumentException("Invalid object: " + Platform.GetTypeName(obj), "obj"); } public virtual bool IsX509v3PKCert diff --git a/crypto/src/asn1/cmp/CrlAnnContent.cs b/crypto/src/asn1/cmp/CrlAnnContent.cs index 3dc11d32c..db8ecfa40 100644 --- a/crypto/src/asn1/cmp/CrlAnnContent.cs +++ b/crypto/src/asn1/cmp/CrlAnnContent.cs @@ -1,6 +1,7 @@ using System; using Org.BouncyCastle.Asn1.X509; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Asn1.Cmp { @@ -22,7 +23,7 @@ namespace Org.BouncyCastle.Asn1.Cmp if (obj is Asn1Sequence) return new CrlAnnContent((Asn1Sequence)obj); - throw new ArgumentException("Invalid object: " + obj.GetType().Name, "obj"); + throw new ArgumentException("Invalid object: " + Platform.GetTypeName(obj), "obj"); } public virtual CertificateList[] ToCertificateListArray() diff --git a/crypto/src/asn1/cmp/ErrorMsgContent.cs b/crypto/src/asn1/cmp/ErrorMsgContent.cs index 2d6353b65..5d2132bb8 100644 --- a/crypto/src/asn1/cmp/ErrorMsgContent.cs +++ b/crypto/src/asn1/cmp/ErrorMsgContent.cs @@ -1,5 +1,7 @@ using System; +using Org.BouncyCastle.Utilities; + namespace Org.BouncyCastle.Asn1.Cmp { public class ErrorMsgContent @@ -35,7 +37,7 @@ namespace Org.BouncyCastle.Asn1.Cmp if (obj is Asn1Sequence) return new ErrorMsgContent((Asn1Sequence)obj); - throw new ArgumentException("Invalid object: " + obj.GetType().Name, "obj"); + throw new ArgumentException("Invalid object: " + Platform.GetTypeName(obj), "obj"); } public ErrorMsgContent(PkiStatusInfo pkiStatusInfo) diff --git a/crypto/src/asn1/cmp/GenMsgContent.cs b/crypto/src/asn1/cmp/GenMsgContent.cs index 9f042491c..f3142b5c6 100644 --- a/crypto/src/asn1/cmp/GenMsgContent.cs +++ b/crypto/src/asn1/cmp/GenMsgContent.cs @@ -1,5 +1,7 @@ using System; +using Org.BouncyCastle.Utilities; + namespace Org.BouncyCastle.Asn1.Cmp { public class GenMsgContent @@ -20,7 +22,7 @@ namespace Org.BouncyCastle.Asn1.Cmp if (obj is Asn1Sequence) return new GenMsgContent((Asn1Sequence)obj); - throw new ArgumentException("Invalid object: " + obj.GetType().Name, "obj"); + throw new ArgumentException("Invalid object: " + Platform.GetTypeName(obj), "obj"); } public GenMsgContent(params InfoTypeAndValue[] itv) diff --git a/crypto/src/asn1/cmp/GenRepContent.cs b/crypto/src/asn1/cmp/GenRepContent.cs index 5bdc5550a..3c3573e37 100644 --- a/crypto/src/asn1/cmp/GenRepContent.cs +++ b/crypto/src/asn1/cmp/GenRepContent.cs @@ -1,5 +1,7 @@ using System; +using Org.BouncyCastle.Utilities; + namespace Org.BouncyCastle.Asn1.Cmp { public class GenRepContent @@ -20,7 +22,7 @@ namespace Org.BouncyCastle.Asn1.Cmp if (obj is Asn1Sequence) return new GenRepContent((Asn1Sequence)obj); - throw new ArgumentException("Invalid object: " + obj.GetType().Name, "obj"); + throw new ArgumentException("Invalid object: " + Platform.GetTypeName(obj), "obj"); } public GenRepContent(params InfoTypeAndValue[] itv) diff --git a/crypto/src/asn1/cmp/InfoTypeAndValue.cs b/crypto/src/asn1/cmp/InfoTypeAndValue.cs index 9b51dba02..0ce6f73ba 100644 --- a/crypto/src/asn1/cmp/InfoTypeAndValue.cs +++ b/crypto/src/asn1/cmp/InfoTypeAndValue.cs @@ -1,5 +1,7 @@ using System; +using Org.BouncyCastle.Utilities; + namespace Org.BouncyCastle.Asn1.Cmp { /** @@ -69,7 +71,7 @@ namespace Org.BouncyCastle.Asn1.Cmp if (obj is Asn1Sequence) return new InfoTypeAndValue((Asn1Sequence)obj); - throw new ArgumentException("Invalid object: " + obj.GetType().Name, "obj"); + throw new ArgumentException("Invalid object: " + Platform.GetTypeName(obj), "obj"); } public InfoTypeAndValue( diff --git a/crypto/src/asn1/cmp/KeyRecRepContent.cs b/crypto/src/asn1/cmp/KeyRecRepContent.cs index b0352f048..00c4612b9 100644 --- a/crypto/src/asn1/cmp/KeyRecRepContent.cs +++ b/crypto/src/asn1/cmp/KeyRecRepContent.cs @@ -1,5 +1,7 @@ using System; +using Org.BouncyCastle.Utilities; + namespace Org.BouncyCastle.Asn1.Cmp { public class KeyRecRepContent @@ -43,7 +45,7 @@ namespace Org.BouncyCastle.Asn1.Cmp if (obj is Asn1Sequence) return new KeyRecRepContent((Asn1Sequence)obj); - throw new ArgumentException("Invalid object: " + obj.GetType().Name, "obj"); + throw new ArgumentException("Invalid object: " + Platform.GetTypeName(obj), "obj"); } public virtual PkiStatusInfo Status diff --git a/crypto/src/asn1/cmp/OobCertHash.cs b/crypto/src/asn1/cmp/OobCertHash.cs index 63ddff7c4..cd8192b40 100644 --- a/crypto/src/asn1/cmp/OobCertHash.cs +++ b/crypto/src/asn1/cmp/OobCertHash.cs @@ -2,6 +2,7 @@ using System; using Org.BouncyCastle.Asn1.Crmf; using Org.BouncyCastle.Asn1.X509; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Asn1.Cmp { @@ -41,7 +42,7 @@ namespace Org.BouncyCastle.Asn1.Cmp if (obj is Asn1Sequence) return new OobCertHash((Asn1Sequence)obj); - throw new ArgumentException("Invalid object: " + obj.GetType().Name, "obj"); + throw new ArgumentException("Invalid object: " + Platform.GetTypeName(obj), "obj"); } public virtual AlgorithmIdentifier HashAlg diff --git a/crypto/src/asn1/cmp/PKIBody.cs b/crypto/src/asn1/cmp/PKIBody.cs index 3205a907e..f17eed64d 100644 --- a/crypto/src/asn1/cmp/PKIBody.cs +++ b/crypto/src/asn1/cmp/PKIBody.cs @@ -2,6 +2,7 @@ using System; using Org.BouncyCastle.Asn1.Crmf; using Org.BouncyCastle.Asn1.Pkcs; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Asn1.Cmp { @@ -47,7 +48,7 @@ namespace Org.BouncyCastle.Asn1.Cmp if (obj is Asn1TaggedObject) return new PkiBody((Asn1TaggedObject)obj); - throw new ArgumentException("Invalid object: " + obj.GetType().Name, "obj"); + throw new ArgumentException("Invalid object: " + Platform.GetTypeName(obj), "obj"); } private PkiBody(Asn1TaggedObject tagged) diff --git a/crypto/src/asn1/cmp/PKIConfirmContent.cs b/crypto/src/asn1/cmp/PKIConfirmContent.cs index 98645766a..d154427a4 100644 --- a/crypto/src/asn1/cmp/PKIConfirmContent.cs +++ b/crypto/src/asn1/cmp/PKIConfirmContent.cs @@ -1,5 +1,7 @@ using System; +using Org.BouncyCastle.Utilities; + namespace Org.BouncyCastle.Asn1.Cmp { public class PkiConfirmContent @@ -13,7 +15,7 @@ namespace Org.BouncyCastle.Asn1.Cmp if (obj is Asn1Null) return new PkiConfirmContent(); - throw new ArgumentException("Invalid object: " + obj.GetType().Name, "obj"); + throw new ArgumentException("Invalid object: " + Platform.GetTypeName(obj), "obj"); } public PkiConfirmContent() diff --git a/crypto/src/asn1/cmp/PKIFreeText.cs b/crypto/src/asn1/cmp/PKIFreeText.cs index 571c8d93a..fef525465 100644 --- a/crypto/src/asn1/cmp/PKIFreeText.cs +++ b/crypto/src/asn1/cmp/PKIFreeText.cs @@ -1,6 +1,8 @@ using System; using System.Collections; +using Org.BouncyCastle.Utilities; + namespace Org.BouncyCastle.Asn1.Cmp { public class PkiFreeText @@ -27,7 +29,7 @@ namespace Org.BouncyCastle.Asn1.Cmp return new PkiFreeText((Asn1Sequence)obj); } - throw new ArgumentException("Unknown object in factory: " + obj.GetType().Name, "obj"); + throw new ArgumentException("Unknown object in factory: " + Platform.GetTypeName(obj), "obj"); } public PkiFreeText( diff --git a/crypto/src/asn1/cmp/PKIHeader.cs b/crypto/src/asn1/cmp/PKIHeader.cs index e758e9f16..577cb45df 100644 --- a/crypto/src/asn1/cmp/PKIHeader.cs +++ b/crypto/src/asn1/cmp/PKIHeader.cs @@ -1,6 +1,7 @@ using System; using Org.BouncyCastle.Asn1.X509; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Asn1.Cmp { @@ -81,7 +82,7 @@ namespace Org.BouncyCastle.Asn1.Cmp if (obj is Asn1Sequence) return new PkiHeader((Asn1Sequence)obj); - throw new ArgumentException("Invalid object: " + obj.GetType().Name, "obj"); + throw new ArgumentException("Invalid object: " + Platform.GetTypeName(obj), "obj"); } public PkiHeader( diff --git a/crypto/src/asn1/cmp/PKIMessages.cs b/crypto/src/asn1/cmp/PKIMessages.cs index ddabdf4ae..eb01e544a 100644 --- a/crypto/src/asn1/cmp/PKIMessages.cs +++ b/crypto/src/asn1/cmp/PKIMessages.cs @@ -1,5 +1,7 @@ using System; +using Org.BouncyCastle.Utilities; + namespace Org.BouncyCastle.Asn1.Cmp { public class PkiMessages @@ -20,7 +22,7 @@ namespace Org.BouncyCastle.Asn1.Cmp if (obj is Asn1Sequence) return new PkiMessages((Asn1Sequence)obj); - throw new ArgumentException("Invalid object: " + obj.GetType().Name, "obj"); + throw new ArgumentException("Invalid object: " + Platform.GetTypeName(obj), "obj"); } public PkiMessages(params PkiMessage[] msgs) diff --git a/crypto/src/asn1/cmp/PKIStatus.cs b/crypto/src/asn1/cmp/PKIStatus.cs index b03dd3d62..ba757dfcf 100644 --- a/crypto/src/asn1/cmp/PKIStatus.cs +++ b/crypto/src/asn1/cmp/PKIStatus.cs @@ -1,6 +1,7 @@ using System; using Org.BouncyCastle.Math; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Asn1.Cmp { @@ -46,7 +47,7 @@ namespace Org.BouncyCastle.Asn1.Cmp if (obj is DerInteger) return new PkiStatusEncodable((DerInteger)obj); - throw new ArgumentException("Invalid object: " + obj.GetType().Name, "obj"); + throw new ArgumentException("Invalid object: " + Platform.GetTypeName(obj), "obj"); } public virtual BigInteger Value diff --git a/crypto/src/asn1/cmp/PKIStatusInfo.cs b/crypto/src/asn1/cmp/PKIStatusInfo.cs index 2463e0081..b19bf7459 100644 --- a/crypto/src/asn1/cmp/PKIStatusInfo.cs +++ b/crypto/src/asn1/cmp/PKIStatusInfo.cs @@ -1,6 +1,7 @@ using System; using Org.BouncyCastle.Math; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Asn1.Cmp { @@ -30,7 +31,7 @@ namespace Org.BouncyCastle.Asn1.Cmp return new PkiStatusInfo((Asn1Sequence)obj); } - throw new ArgumentException("Unknown object in factory: " + obj.GetType().Name, "obj"); + throw new ArgumentException("Unknown object in factory: " + Platform.GetTypeName(obj), "obj"); } public PkiStatusInfo( diff --git a/crypto/src/asn1/cmp/PbmParameter.cs b/crypto/src/asn1/cmp/PbmParameter.cs index 59b1bd7bb..206b89ba1 100644 --- a/crypto/src/asn1/cmp/PbmParameter.cs +++ b/crypto/src/asn1/cmp/PbmParameter.cs @@ -1,6 +1,7 @@ using System; using Org.BouncyCastle.Asn1.X509; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Asn1.Cmp { @@ -28,7 +29,7 @@ namespace Org.BouncyCastle.Asn1.Cmp if (obj is Asn1Sequence) return new PbmParameter((Asn1Sequence)obj); - throw new ArgumentException("Invalid object: " + obj.GetType().Name, "obj"); + throw new ArgumentException("Invalid object: " + Platform.GetTypeName(obj), "obj"); } public PbmParameter( diff --git a/crypto/src/asn1/cmp/PollRepContent.cs b/crypto/src/asn1/cmp/PollRepContent.cs index 4045ac7ed..f8bb098a2 100644 --- a/crypto/src/asn1/cmp/PollRepContent.cs +++ b/crypto/src/asn1/cmp/PollRepContent.cs @@ -1,5 +1,7 @@ using System; +using Org.BouncyCastle.Utilities; + namespace Org.BouncyCastle.Asn1.Cmp { public class PollRepContent @@ -28,7 +30,7 @@ namespace Org.BouncyCastle.Asn1.Cmp if (obj is Asn1Sequence) return new PollRepContent((Asn1Sequence)obj); - throw new ArgumentException("Invalid object: " + obj.GetType().Name, "obj"); + throw new ArgumentException("Invalid object: " + Platform.GetTypeName(obj), "obj"); } public virtual DerInteger CertReqID diff --git a/crypto/src/asn1/cmp/PollReqContent.cs b/crypto/src/asn1/cmp/PollReqContent.cs index ca2164151..dd9b0c352 100644 --- a/crypto/src/asn1/cmp/PollReqContent.cs +++ b/crypto/src/asn1/cmp/PollReqContent.cs @@ -1,5 +1,7 @@ using System; +using Org.BouncyCastle.Utilities; + namespace Org.BouncyCastle.Asn1.Cmp { public class PollReqContent @@ -20,7 +22,7 @@ namespace Org.BouncyCastle.Asn1.Cmp if (obj is Asn1Sequence) return new PollReqContent((Asn1Sequence)obj); - throw new ArgumentException("Invalid object: " + obj.GetType().Name, "obj"); + throw new ArgumentException("Invalid object: " + Platform.GetTypeName(obj), "obj"); } public virtual DerInteger[][] GetCertReqIDs() diff --git a/crypto/src/asn1/cmp/PopoDecKeyChallContent.cs b/crypto/src/asn1/cmp/PopoDecKeyChallContent.cs index 20b173b85..03a13a5d5 100644 --- a/crypto/src/asn1/cmp/PopoDecKeyChallContent.cs +++ b/crypto/src/asn1/cmp/PopoDecKeyChallContent.cs @@ -1,5 +1,7 @@ using System; +using Org.BouncyCastle.Utilities; + namespace Org.BouncyCastle.Asn1.Cmp { public class PopoDecKeyChallContent @@ -20,7 +22,7 @@ namespace Org.BouncyCastle.Asn1.Cmp if (obj is Asn1Sequence) return new PopoDecKeyChallContent((Asn1Sequence)obj); - throw new ArgumentException("Invalid object: " + obj.GetType().Name, "obj"); + throw new ArgumentException("Invalid object: " + Platform.GetTypeName(obj), "obj"); } public virtual Challenge[] ToChallengeArray() diff --git a/crypto/src/asn1/cmp/PopoDecKeyRespContent.cs b/crypto/src/asn1/cmp/PopoDecKeyRespContent.cs index 8c322e4ec..73f59b7c1 100644 --- a/crypto/src/asn1/cmp/PopoDecKeyRespContent.cs +++ b/crypto/src/asn1/cmp/PopoDecKeyRespContent.cs @@ -1,5 +1,7 @@ using System; +using Org.BouncyCastle.Utilities; + namespace Org.BouncyCastle.Asn1.Cmp { public class PopoDecKeyRespContent @@ -20,7 +22,7 @@ namespace Org.BouncyCastle.Asn1.Cmp if (obj is Asn1Sequence) return new PopoDecKeyRespContent((Asn1Sequence)obj); - throw new ArgumentException("Invalid object: " + obj.GetType().Name, "obj"); + throw new ArgumentException("Invalid object: " + Platform.GetTypeName(obj), "obj"); } public virtual DerInteger[] ToDerIntegerArray() diff --git a/crypto/src/asn1/cmp/ProtectedPart.cs b/crypto/src/asn1/cmp/ProtectedPart.cs index db6798fee..ed90708f9 100644 --- a/crypto/src/asn1/cmp/ProtectedPart.cs +++ b/crypto/src/asn1/cmp/ProtectedPart.cs @@ -1,5 +1,7 @@ using System; +using Org.BouncyCastle.Utilities; + namespace Org.BouncyCastle.Asn1.Cmp { public class ProtectedPart @@ -22,7 +24,7 @@ namespace Org.BouncyCastle.Asn1.Cmp if (obj is Asn1Sequence) return new ProtectedPart((Asn1Sequence)obj); - throw new ArgumentException("Invalid object: " + obj.GetType().Name, "obj"); + throw new ArgumentException("Invalid object: " + Platform.GetTypeName(obj), "obj"); } public ProtectedPart(PkiHeader header, PkiBody body) diff --git a/crypto/src/asn1/cmp/RevAnnContent.cs b/crypto/src/asn1/cmp/RevAnnContent.cs index 2c3bd5f77..d5d42625c 100644 --- a/crypto/src/asn1/cmp/RevAnnContent.cs +++ b/crypto/src/asn1/cmp/RevAnnContent.cs @@ -2,6 +2,7 @@ using System; using Org.BouncyCastle.Asn1.Crmf; using Org.BouncyCastle.Asn1.X509; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Asn1.Cmp { @@ -35,7 +36,7 @@ namespace Org.BouncyCastle.Asn1.Cmp if (obj is Asn1Sequence) return new RevAnnContent((Asn1Sequence)obj); - throw new ArgumentException("Invalid object: " + obj.GetType().Name, "obj"); + throw new ArgumentException("Invalid object: " + Platform.GetTypeName(obj), "obj"); } public virtual PkiStatusEncodable Status diff --git a/crypto/src/asn1/cmp/RevDetails.cs b/crypto/src/asn1/cmp/RevDetails.cs index 6bdf5b2e9..7d2a65ab9 100644 --- a/crypto/src/asn1/cmp/RevDetails.cs +++ b/crypto/src/asn1/cmp/RevDetails.cs @@ -2,6 +2,7 @@ using System; using Org.BouncyCastle.Asn1.Crmf; using Org.BouncyCastle.Asn1.X509; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Asn1.Cmp { @@ -27,7 +28,7 @@ namespace Org.BouncyCastle.Asn1.Cmp if (obj is Asn1Sequence) return new RevDetails((Asn1Sequence)obj); - throw new ArgumentException("Invalid object: " + obj.GetType().Name, "obj"); + throw new ArgumentException("Invalid object: " + Platform.GetTypeName(obj), "obj"); } public RevDetails(CertTemplate certDetails) diff --git a/crypto/src/asn1/cmp/RevRepContent.cs b/crypto/src/asn1/cmp/RevRepContent.cs index 47987265a..8e382a60d 100644 --- a/crypto/src/asn1/cmp/RevRepContent.cs +++ b/crypto/src/asn1/cmp/RevRepContent.cs @@ -2,6 +2,7 @@ using System; using Org.BouncyCastle.Asn1.Crmf; using Org.BouncyCastle.Asn1.X509; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Asn1.Cmp { @@ -39,7 +40,7 @@ namespace Org.BouncyCastle.Asn1.Cmp if (obj is Asn1Sequence) return new RevRepContent((Asn1Sequence)obj); - throw new ArgumentException("Invalid object: " + obj.GetType().Name, "obj"); + throw new ArgumentException("Invalid object: " + Platform.GetTypeName(obj), "obj"); } public virtual PkiStatusInfo[] GetStatus() diff --git a/crypto/src/asn1/cmp/RevReqContent.cs b/crypto/src/asn1/cmp/RevReqContent.cs index fbf869203..1522d3789 100644 --- a/crypto/src/asn1/cmp/RevReqContent.cs +++ b/crypto/src/asn1/cmp/RevReqContent.cs @@ -1,5 +1,7 @@ using System; +using Org.BouncyCastle.Utilities; + namespace Org.BouncyCastle.Asn1.Cmp { public class RevReqContent @@ -20,7 +22,7 @@ namespace Org.BouncyCastle.Asn1.Cmp if (obj is Asn1Sequence) return new RevReqContent((Asn1Sequence)obj); - throw new ArgumentException("Invalid object: " + obj.GetType().Name, "obj"); + throw new ArgumentException("Invalid object: " + Platform.GetTypeName(obj), "obj"); } public RevReqContent(params RevDetails[] revDetails) diff --git a/crypto/src/asn1/cms/Attribute.cs b/crypto/src/asn1/cms/Attribute.cs index c4a104a3f..69ac44148 100644 --- a/crypto/src/asn1/cms/Attribute.cs +++ b/crypto/src/asn1/cms/Attribute.cs @@ -1,6 +1,6 @@ using System; -using Org.BouncyCastle.Asn1; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Asn1.Cms { @@ -25,7 +25,7 @@ namespace Org.BouncyCastle.Asn1.Cms if (obj is Asn1Sequence) return new Attribute((Asn1Sequence) obj); - throw new ArgumentException("unknown object in factory: " + obj.GetType().Name, "obj"); + throw new ArgumentException("unknown object in factory: " + Platform.GetTypeName(obj), "obj"); } public Attribute( diff --git a/crypto/src/asn1/cms/AuthEnvelopedData.cs b/crypto/src/asn1/cms/AuthEnvelopedData.cs index 4260d80f9..c30ec6bbd 100644 --- a/crypto/src/asn1/cms/AuthEnvelopedData.cs +++ b/crypto/src/asn1/cms/AuthEnvelopedData.cs @@ -1,5 +1,7 @@ using System; +using Org.BouncyCastle.Utilities; + namespace Org.BouncyCastle.Asn1.Cms { public class AuthEnvelopedData @@ -119,7 +121,7 @@ namespace Org.BouncyCastle.Asn1.Cms if (obj is Asn1Sequence) return new AuthEnvelopedData((Asn1Sequence)obj); - throw new ArgumentException("Invalid AuthEnvelopedData: " + obj.GetType().Name); + throw new ArgumentException("Invalid AuthEnvelopedData: " + Platform.GetTypeName(obj)); } public DerInteger Version diff --git a/crypto/src/asn1/cms/AuthenticatedData.cs b/crypto/src/asn1/cms/AuthenticatedData.cs index 15286d1aa..6f13a6f30 100644 --- a/crypto/src/asn1/cms/AuthenticatedData.cs +++ b/crypto/src/asn1/cms/AuthenticatedData.cs @@ -1,6 +1,7 @@ using System; using Org.BouncyCastle.Asn1.X509; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Asn1.Cms { @@ -123,7 +124,7 @@ namespace Org.BouncyCastle.Asn1.Cms return new AuthenticatedData((Asn1Sequence)obj); } - throw new ArgumentException("Invalid AuthenticatedData: " + obj.GetType().Name); + throw new ArgumentException("Invalid AuthenticatedData: " + Platform.GetTypeName(obj)); } public DerInteger Version diff --git a/crypto/src/asn1/cms/CompressedData.cs b/crypto/src/asn1/cms/CompressedData.cs index 5a2869b8c..154ed35c0 100644 --- a/crypto/src/asn1/cms/CompressedData.cs +++ b/crypto/src/asn1/cms/CompressedData.cs @@ -1,7 +1,7 @@ using System; -using Org.BouncyCastle.Asn1; using Org.BouncyCastle.Asn1.X509; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Asn1.Cms { @@ -70,7 +70,7 @@ namespace Org.BouncyCastle.Asn1.Cms if (obj is Asn1Sequence) return new CompressedData((Asn1Sequence) obj); - throw new ArgumentException("Invalid CompressedData: " + obj.GetType().Name); + throw new ArgumentException("Invalid CompressedData: " + Platform.GetTypeName(obj)); } public DerInteger Version diff --git a/crypto/src/asn1/cms/ContentInfo.cs b/crypto/src/asn1/cms/ContentInfo.cs index 278ceca46..f130a4bc7 100644 --- a/crypto/src/asn1/cms/ContentInfo.cs +++ b/crypto/src/asn1/cms/ContentInfo.cs @@ -1,7 +1,7 @@ using System; using System.Collections; -using Org.BouncyCastle.Asn1; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Asn1.Cms { @@ -20,7 +20,7 @@ namespace Org.BouncyCastle.Asn1.Cms if (obj is Asn1Sequence) return new ContentInfo((Asn1Sequence) obj); - throw new ArgumentException("unknown object in factory: " + obj.GetType().Name); + throw new ArgumentException("unknown object in factory: " + Platform.GetTypeName(obj)); } public static ContentInfo GetInstance(Asn1TaggedObject obj, bool isExplicit) diff --git a/crypto/src/asn1/cms/EncryptedContentInfo.cs b/crypto/src/asn1/cms/EncryptedContentInfo.cs index 4fdc47138..999f2a01e 100644 --- a/crypto/src/asn1/cms/EncryptedContentInfo.cs +++ b/crypto/src/asn1/cms/EncryptedContentInfo.cs @@ -1,7 +1,7 @@ using System; -using Org.BouncyCastle.Asn1; using Org.BouncyCastle.Asn1.X509; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Asn1.Cms { @@ -50,7 +50,7 @@ namespace Org.BouncyCastle.Asn1.Cms if (obj is Asn1Sequence) return new EncryptedContentInfo((Asn1Sequence)obj); - throw new ArgumentException("Invalid EncryptedContentInfo: " + obj.GetType().Name); + throw new ArgumentException("Invalid EncryptedContentInfo: " + Platform.GetTypeName(obj)); } public DerObjectIdentifier ContentType diff --git a/crypto/src/asn1/cms/EncryptedData.cs b/crypto/src/asn1/cms/EncryptedData.cs index cb109a640..b8492d14b 100644 --- a/crypto/src/asn1/cms/EncryptedData.cs +++ b/crypto/src/asn1/cms/EncryptedData.cs @@ -1,5 +1,7 @@ using System; +using Org.BouncyCastle.Utilities; + namespace Org.BouncyCastle.Asn1.Cms { public class EncryptedData @@ -18,7 +20,7 @@ namespace Org.BouncyCastle.Asn1.Cms if (obj is Asn1Sequence) return new EncryptedData((Asn1Sequence) obj); - throw new ArgumentException("Invalid EncryptedData: " + obj.GetType().Name); + throw new ArgumentException("Invalid EncryptedData: " + Platform.GetTypeName(obj)); } public EncryptedData( diff --git a/crypto/src/asn1/cms/Evidence.cs b/crypto/src/asn1/cms/Evidence.cs index 4745e565b..8374aed55 100644 --- a/crypto/src/asn1/cms/Evidence.cs +++ b/crypto/src/asn1/cms/Evidence.cs @@ -1,5 +1,7 @@ using System; +using Org.BouncyCastle.Utilities; + namespace Org.BouncyCastle.Asn1.Cms { public class Evidence @@ -28,7 +30,7 @@ namespace Org.BouncyCastle.Asn1.Cms if (obj is Asn1TaggedObject) return new Evidence(Asn1TaggedObject.GetInstance(obj)); - throw new ArgumentException("Unknown object in GetInstance: " + obj.GetType().FullName, "obj"); + throw new ArgumentException("Unknown object in GetInstance: " + Platform.GetTypeName(obj), "obj"); } public virtual TimeStampTokenEvidence TstEvidence diff --git a/crypto/src/asn1/cms/KEKIdentifier.cs b/crypto/src/asn1/cms/KEKIdentifier.cs index e5d1d9090..a42217440 100644 --- a/crypto/src/asn1/cms/KEKIdentifier.cs +++ b/crypto/src/asn1/cms/KEKIdentifier.cs @@ -1,6 +1,6 @@ using System; -using Org.BouncyCastle.Asn1; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Asn1.Cms { @@ -80,7 +80,7 @@ namespace Org.BouncyCastle.Asn1.Cms if (obj is Asn1Sequence) return new KekIdentifier((Asn1Sequence)obj); - throw new ArgumentException("Invalid KekIdentifier: " + obj.GetType().Name); + throw new ArgumentException("Invalid KekIdentifier: " + Platform.GetTypeName(obj)); } public Asn1OctetString KeyIdentifier diff --git a/crypto/src/asn1/cms/KEKRecipientInfo.cs b/crypto/src/asn1/cms/KEKRecipientInfo.cs index d847b50cc..810e7fc97 100644 --- a/crypto/src/asn1/cms/KEKRecipientInfo.cs +++ b/crypto/src/asn1/cms/KEKRecipientInfo.cs @@ -1,7 +1,7 @@ using System; -using Org.BouncyCastle.Asn1; using Org.BouncyCastle.Asn1.X509; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Asn1.Cms { @@ -64,7 +64,7 @@ namespace Org.BouncyCastle.Asn1.Cms if(obj is Asn1Sequence) return new KekRecipientInfo((Asn1Sequence)obj); - throw new ArgumentException("Invalid KekRecipientInfo: " + obj.GetType().Name); + throw new ArgumentException("Invalid KekRecipientInfo: " + Platform.GetTypeName(obj)); } public DerInteger Version diff --git a/crypto/src/asn1/cms/KeyAgreeRecipientIdentifier.cs b/crypto/src/asn1/cms/KeyAgreeRecipientIdentifier.cs index fa6fdb0f3..0256c2dc2 100644 --- a/crypto/src/asn1/cms/KeyAgreeRecipientIdentifier.cs +++ b/crypto/src/asn1/cms/KeyAgreeRecipientIdentifier.cs @@ -1,5 +1,7 @@ using System; +using Org.BouncyCastle.Utilities; + namespace Org.BouncyCastle.Asn1.Cms { public class KeyAgreeRecipientIdentifier @@ -42,7 +44,7 @@ namespace Org.BouncyCastle.Asn1.Cms (Asn1TaggedObject)obj, false)); } - throw new ArgumentException("Invalid KeyAgreeRecipientIdentifier: " + obj.GetType().FullName, "obj"); + throw new ArgumentException("Invalid KeyAgreeRecipientIdentifier: " + Platform.GetTypeName(obj), "obj"); } private readonly IssuerAndSerialNumber issuerSerial; diff --git a/crypto/src/asn1/cms/KeyAgreeRecipientInfo.cs b/crypto/src/asn1/cms/KeyAgreeRecipientInfo.cs index aafb008d4..62a38925b 100644 --- a/crypto/src/asn1/cms/KeyAgreeRecipientInfo.cs +++ b/crypto/src/asn1/cms/KeyAgreeRecipientInfo.cs @@ -1,7 +1,7 @@ using System; -using Org.BouncyCastle.Asn1; using Org.BouncyCastle.Asn1.X509; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Asn1.Cms { @@ -80,7 +80,7 @@ namespace Org.BouncyCastle.Asn1.Cms return new KeyAgreeRecipientInfo((Asn1Sequence)obj); throw new ArgumentException( - "Illegal object in KeyAgreeRecipientInfo: " + obj.GetType().Name); + "Illegal object in KeyAgreeRecipientInfo: " + Platform.GetTypeName(obj)); } diff --git a/crypto/src/asn1/cms/KeyTransRecipientInfo.cs b/crypto/src/asn1/cms/KeyTransRecipientInfo.cs index aae18c59d..5e4fd22b4 100644 --- a/crypto/src/asn1/cms/KeyTransRecipientInfo.cs +++ b/crypto/src/asn1/cms/KeyTransRecipientInfo.cs @@ -1,7 +1,7 @@ using System; -using Org.BouncyCastle.Asn1; using Org.BouncyCastle.Asn1.X509; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Asn1.Cms { @@ -57,7 +57,7 @@ namespace Org.BouncyCastle.Asn1.Cms return new KeyTransRecipientInfo((Asn1Sequence) obj); throw new ArgumentException( - "Illegal object in KeyTransRecipientInfo: " + obj.GetType().Name); + "Illegal object in KeyTransRecipientInfo: " + Platform.GetTypeName(obj)); } public DerInteger Version diff --git a/crypto/src/asn1/cms/OriginatorIdentifierOrKey.cs b/crypto/src/asn1/cms/OriginatorIdentifierOrKey.cs index d33a11725..f197fe965 100644 --- a/crypto/src/asn1/cms/OriginatorIdentifierOrKey.cs +++ b/crypto/src/asn1/cms/OriginatorIdentifierOrKey.cs @@ -1,7 +1,7 @@ using System; -using Org.BouncyCastle.Asn1; using Org.BouncyCastle.Asn1.X509; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Asn1.Cms { @@ -95,7 +95,7 @@ namespace Org.BouncyCastle.Asn1.Cms if (o is Asn1TaggedObject) return new OriginatorIdentifierOrKey((Asn1TaggedObject)o); - throw new ArgumentException("Invalid OriginatorIdentifierOrKey: " + o.GetType().Name); + throw new ArgumentException("Invalid OriginatorIdentifierOrKey: " + Platform.GetTypeName(o)); } public Asn1Encodable ID diff --git a/crypto/src/asn1/cms/OriginatorInfo.cs b/crypto/src/asn1/cms/OriginatorInfo.cs index b4549bc36..33b049efa 100644 --- a/crypto/src/asn1/cms/OriginatorInfo.cs +++ b/crypto/src/asn1/cms/OriginatorInfo.cs @@ -1,6 +1,6 @@ using System; -using Org.BouncyCastle.Asn1; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Asn1.Cms { @@ -79,7 +79,7 @@ namespace Org.BouncyCastle.Asn1.Cms if (obj is Asn1Sequence) return new OriginatorInfo((Asn1Sequence)obj); - throw new ArgumentException("Invalid OriginatorInfo: " + obj.GetType().Name); + throw new ArgumentException("Invalid OriginatorInfo: " + Platform.GetTypeName(obj)); } public Asn1Set Certificates diff --git a/crypto/src/asn1/cms/OriginatorPublicKey.cs b/crypto/src/asn1/cms/OriginatorPublicKey.cs index 988841aa5..9f29c6242 100644 --- a/crypto/src/asn1/cms/OriginatorPublicKey.cs +++ b/crypto/src/asn1/cms/OriginatorPublicKey.cs @@ -1,7 +1,7 @@ using System; -using Org.BouncyCastle.Asn1; using Org.BouncyCastle.Asn1.X509; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Asn1.Cms { @@ -58,7 +58,7 @@ namespace Org.BouncyCastle.Asn1.Cms if (obj is Asn1Sequence) return new OriginatorPublicKey(Asn1Sequence.GetInstance(obj)); - throw new ArgumentException("Invalid OriginatorPublicKey: " + obj.GetType().Name); + throw new ArgumentException("Invalid OriginatorPublicKey: " + Platform.GetTypeName(obj)); } public AlgorithmIdentifier Algorithm diff --git a/crypto/src/asn1/cms/OtherKeyAttribute.cs b/crypto/src/asn1/cms/OtherKeyAttribute.cs index 271059175..285c88154 100644 --- a/crypto/src/asn1/cms/OtherKeyAttribute.cs +++ b/crypto/src/asn1/cms/OtherKeyAttribute.cs @@ -1,6 +1,6 @@ using System; -using Org.BouncyCastle.Asn1; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Asn1.Cms { @@ -25,7 +25,7 @@ namespace Org.BouncyCastle.Asn1.Cms if (obj is Asn1Sequence) return new OtherKeyAttribute((Asn1Sequence) obj); - throw new ArgumentException("unknown object in factory: " + obj.GetType().Name, "obj"); + throw new ArgumentException("unknown object in factory: " + Platform.GetTypeName(obj), "obj"); } public OtherKeyAttribute( diff --git a/crypto/src/asn1/cms/PasswordRecipientInfo.cs b/crypto/src/asn1/cms/PasswordRecipientInfo.cs index 800b57951..7f275fde7 100644 --- a/crypto/src/asn1/cms/PasswordRecipientInfo.cs +++ b/crypto/src/asn1/cms/PasswordRecipientInfo.cs @@ -1,7 +1,7 @@ using System; -using Org.BouncyCastle.Asn1; using Org.BouncyCastle.Asn1.X509; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Asn1.Cms { @@ -82,7 +82,7 @@ namespace Org.BouncyCastle.Asn1.Cms if (obj is Asn1Sequence) return new PasswordRecipientInfo((Asn1Sequence) obj); - throw new ArgumentException("Invalid PasswordRecipientInfo: " + obj.GetType().Name); + throw new ArgumentException("Invalid PasswordRecipientInfo: " + Platform.GetTypeName(obj)); } public DerInteger Version diff --git a/crypto/src/asn1/cms/RecipientEncryptedKey.cs b/crypto/src/asn1/cms/RecipientEncryptedKey.cs index 5ba25a742..1afba4ab1 100644 --- a/crypto/src/asn1/cms/RecipientEncryptedKey.cs +++ b/crypto/src/asn1/cms/RecipientEncryptedKey.cs @@ -1,5 +1,7 @@ using System; +using Org.BouncyCastle.Utilities; + namespace Org.BouncyCastle.Asn1.Cms { public class RecipientEncryptedKey @@ -50,7 +52,7 @@ namespace Org.BouncyCastle.Asn1.Cms return new RecipientEncryptedKey((Asn1Sequence) obj); } - throw new ArgumentException("Invalid RecipientEncryptedKey: " + obj.GetType().FullName, "obj"); + throw new ArgumentException("Invalid RecipientEncryptedKey: " + Platform.GetTypeName(obj), "obj"); } public RecipientEncryptedKey( diff --git a/crypto/src/asn1/cms/RecipientIdentifier.cs b/crypto/src/asn1/cms/RecipientIdentifier.cs index 4982bc16a..f29fa8d7c 100644 --- a/crypto/src/asn1/cms/RecipientIdentifier.cs +++ b/crypto/src/asn1/cms/RecipientIdentifier.cs @@ -1,6 +1,6 @@ using System; -using Org.BouncyCastle.Asn1; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Asn1.Cms { @@ -49,7 +49,7 @@ namespace Org.BouncyCastle.Asn1.Cms return new RecipientIdentifier((Asn1Object) o); throw new ArgumentException( - "Illegal object in RecipientIdentifier: " + o.GetType().Name); + "Illegal object in RecipientIdentifier: " + Platform.GetTypeName(o)); } public bool IsTagged diff --git a/crypto/src/asn1/cms/RecipientInfo.cs b/crypto/src/asn1/cms/RecipientInfo.cs index daaf5a5e4..c03ad907f 100644 --- a/crypto/src/asn1/cms/RecipientInfo.cs +++ b/crypto/src/asn1/cms/RecipientInfo.cs @@ -1,6 +1,6 @@ using System; -using Org.BouncyCastle.Asn1; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Asn1.Cms { @@ -57,7 +57,7 @@ namespace Org.BouncyCastle.Asn1.Cms if (o is Asn1TaggedObject) return new RecipientInfo((Asn1TaggedObject) o); - throw new ArgumentException("unknown object in factory: " + o.GetType().Name); + throw new ArgumentException("unknown object in factory: " + Platform.GetTypeName(o)); } public DerInteger Version diff --git a/crypto/src/asn1/cms/RecipientKeyIdentifier.cs b/crypto/src/asn1/cms/RecipientKeyIdentifier.cs index f3e45644b..995ddab51 100644 --- a/crypto/src/asn1/cms/RecipientKeyIdentifier.cs +++ b/crypto/src/asn1/cms/RecipientKeyIdentifier.cs @@ -1,6 +1,6 @@ using System; -using Org.BouncyCastle.Asn1; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Asn1.Cms { @@ -97,7 +97,7 @@ namespace Org.BouncyCastle.Asn1.Cms if (obj is Asn1Sequence) return new RecipientKeyIdentifier((Asn1Sequence) obj); - throw new ArgumentException("Invalid RecipientKeyIdentifier: " + obj.GetType().Name); + throw new ArgumentException("Invalid RecipientKeyIdentifier: " + Platform.GetTypeName(obj)); } public Asn1OctetString SubjectKeyIdentifier diff --git a/crypto/src/asn1/cms/SignedData.cs b/crypto/src/asn1/cms/SignedData.cs index 6cea79a49..957b81cd8 100644 --- a/crypto/src/asn1/cms/SignedData.cs +++ b/crypto/src/asn1/cms/SignedData.cs @@ -1,7 +1,7 @@ using System; using System.Collections; -using Org.BouncyCastle.Asn1; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Asn1.Cms { @@ -34,7 +34,7 @@ namespace Org.BouncyCastle.Asn1.Cms if (obj is Asn1Sequence) return new SignedData((Asn1Sequence) obj); - throw new ArgumentException("Unknown object in factory: " + obj.GetType().FullName, "obj"); + throw new ArgumentException("Unknown object in factory: " + Platform.GetTypeName(obj), "obj"); } public SignedData( diff --git a/crypto/src/asn1/cms/SignedDataParser.cs b/crypto/src/asn1/cms/SignedDataParser.cs index 341309263..cd07f4057 100644 --- a/crypto/src/asn1/cms/SignedDataParser.cs +++ b/crypto/src/asn1/cms/SignedDataParser.cs @@ -1,6 +1,8 @@ using System; using System.IO; +using Org.BouncyCastle.Utilities; + namespace Org.BouncyCastle.Asn1.Cms { /** @@ -32,7 +34,7 @@ namespace Org.BouncyCastle.Asn1.Cms if (o is Asn1SequenceParser) return new SignedDataParser((Asn1SequenceParser)o); - throw new IOException("unknown object encountered: " + o.GetType().Name); + throw new IOException("unknown object encountered: " + Platform.GetTypeName(o)); } public SignedDataParser( diff --git a/crypto/src/asn1/cms/SignerIdentifier.cs b/crypto/src/asn1/cms/SignerIdentifier.cs index 5742cee75..195ab741f 100644 --- a/crypto/src/asn1/cms/SignerIdentifier.cs +++ b/crypto/src/asn1/cms/SignerIdentifier.cs @@ -1,6 +1,6 @@ using System; -using Org.BouncyCastle.Asn1; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Asn1.Cms { @@ -49,7 +49,7 @@ namespace Org.BouncyCastle.Asn1.Cms return new SignerIdentifier((Asn1Object) o); throw new ArgumentException( - "Illegal object in SignerIdentifier: " + o.GetType().Name); + "Illegal object in SignerIdentifier: " + Platform.GetTypeName(o)); } public bool IsTagged diff --git a/crypto/src/asn1/cms/SignerInfo.cs b/crypto/src/asn1/cms/SignerInfo.cs index a4e893d96..b6bd319b0 100644 --- a/crypto/src/asn1/cms/SignerInfo.cs +++ b/crypto/src/asn1/cms/SignerInfo.cs @@ -1,8 +1,8 @@ using System; using System.Collections; -using Org.BouncyCastle.Asn1; using Org.BouncyCastle.Asn1.X509; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Asn1.Cms { @@ -26,7 +26,7 @@ namespace Org.BouncyCastle.Asn1.Cms if (obj is Asn1Sequence) return new SignerInfo((Asn1Sequence) obj); - throw new ArgumentException("Unknown object in factory: " + obj.GetType().FullName, "obj"); + throw new ArgumentException("Unknown object in factory: " + Platform.GetTypeName(obj), "obj"); } public SignerInfo( diff --git a/crypto/src/asn1/cms/Time.cs b/crypto/src/asn1/cms/Time.cs index e5730245e..52fb4f937 100644 --- a/crypto/src/asn1/cms/Time.cs +++ b/crypto/src/asn1/cms/Time.cs @@ -1,6 +1,8 @@ using System; using System.Globalization; +using Org.BouncyCastle.Utilities; + namespace Org.BouncyCastle.Asn1.Cms { public class Time @@ -58,7 +60,7 @@ namespace Org.BouncyCastle.Asn1.Cms if (obj is DerGeneralizedTime) return new Time((DerGeneralizedTime)obj); - throw new ArgumentException("unknown object in factory: " + obj.GetType().Name, "obj"); + throw new ArgumentException("unknown object in factory: " + Platform.GetTypeName(obj), "obj"); } public string TimeString diff --git a/crypto/src/asn1/cms/ecc/MQVuserKeyingMaterial.cs b/crypto/src/asn1/cms/ecc/MQVuserKeyingMaterial.cs index 53c5c706b..dc4ac1a4a 100644 --- a/crypto/src/asn1/cms/ecc/MQVuserKeyingMaterial.cs +++ b/crypto/src/asn1/cms/ecc/MQVuserKeyingMaterial.cs @@ -1,5 +1,7 @@ using System; +using Org.BouncyCastle.Utilities; + namespace Org.BouncyCastle.Asn1.Cms.Ecc { public class MQVuserKeyingMaterial @@ -67,7 +69,7 @@ namespace Org.BouncyCastle.Asn1.Cms.Ecc return new MQVuserKeyingMaterial((Asn1Sequence)obj); } - throw new ArgumentException("Invalid MQVuserKeyingMaterial: " + obj.GetType().Name); + throw new ArgumentException("Invalid MQVuserKeyingMaterial: " + Platform.GetTypeName(obj)); } public OriginatorPublicKey EphemeralPublicKey diff --git a/crypto/src/asn1/crmf/AttributeTypeAndValue.cs b/crypto/src/asn1/crmf/AttributeTypeAndValue.cs index 823668992..0a4b5bdbe 100644 --- a/crypto/src/asn1/crmf/AttributeTypeAndValue.cs +++ b/crypto/src/asn1/crmf/AttributeTypeAndValue.cs @@ -1,5 +1,7 @@ using System; +using Org.BouncyCastle.Utilities; + namespace Org.BouncyCastle.Asn1.Crmf { public class AttributeTypeAndValue @@ -22,7 +24,7 @@ namespace Org.BouncyCastle.Asn1.Crmf if (obj is Asn1Sequence) return new AttributeTypeAndValue((Asn1Sequence)obj); - throw new ArgumentException("Invalid object: " + obj.GetType().Name, "obj"); + throw new ArgumentException("Invalid object: " + Platform.GetTypeName(obj), "obj"); } public AttributeTypeAndValue( diff --git a/crypto/src/asn1/crmf/CertId.cs b/crypto/src/asn1/crmf/CertId.cs index 10c2cc8b4..f0cc94691 100644 --- a/crypto/src/asn1/crmf/CertId.cs +++ b/crypto/src/asn1/crmf/CertId.cs @@ -1,6 +1,7 @@ using System; using Org.BouncyCastle.Asn1.X509; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Asn1.Crmf { @@ -24,7 +25,7 @@ namespace Org.BouncyCastle.Asn1.Crmf if (obj is Asn1Sequence) return new CertId((Asn1Sequence)obj); - throw new ArgumentException("Invalid object: " + obj.GetType().Name, "obj"); + throw new ArgumentException("Invalid object: " + Platform.GetTypeName(obj), "obj"); } public static CertId GetInstance(Asn1TaggedObject obj, bool isExplicit) diff --git a/crypto/src/asn1/crmf/CertReqMessages.cs b/crypto/src/asn1/crmf/CertReqMessages.cs index 9247281e8..422950b9e 100644 --- a/crypto/src/asn1/crmf/CertReqMessages.cs +++ b/crypto/src/asn1/crmf/CertReqMessages.cs @@ -1,5 +1,7 @@ using System; +using Org.BouncyCastle.Utilities; + namespace Org.BouncyCastle.Asn1.Crmf { public class CertReqMessages @@ -20,7 +22,7 @@ namespace Org.BouncyCastle.Asn1.Crmf if (obj is Asn1Sequence) return new CertReqMessages((Asn1Sequence)obj); - throw new ArgumentException("Invalid object: " + obj.GetType().Name, "obj"); + throw new ArgumentException("Invalid object: " + Platform.GetTypeName(obj), "obj"); } public CertReqMessages(params CertReqMsg[] msgs) diff --git a/crypto/src/asn1/crmf/Controls.cs b/crypto/src/asn1/crmf/Controls.cs index cc52ea4bb..e8b9f3db0 100644 --- a/crypto/src/asn1/crmf/Controls.cs +++ b/crypto/src/asn1/crmf/Controls.cs @@ -1,5 +1,7 @@ using System; +using Org.BouncyCastle.Utilities; + namespace Org.BouncyCastle.Asn1.Crmf { public class Controls @@ -20,7 +22,7 @@ namespace Org.BouncyCastle.Asn1.Crmf if (obj is Asn1Sequence) return new Controls((Asn1Sequence)obj); - throw new ArgumentException("Invalid object: " + obj.GetType().Name, "obj"); + throw new ArgumentException("Invalid object: " + Platform.GetTypeName(obj), "obj"); } public Controls(params AttributeTypeAndValue[] atvs) diff --git a/crypto/src/asn1/crmf/PKIArchiveOptions.cs b/crypto/src/asn1/crmf/PKIArchiveOptions.cs index 910f73b22..1813d87a7 100644 --- a/crypto/src/asn1/crmf/PKIArchiveOptions.cs +++ b/crypto/src/asn1/crmf/PKIArchiveOptions.cs @@ -1,5 +1,7 @@ using System; +using Org.BouncyCastle.Utilities; + namespace Org.BouncyCastle.Asn1.Crmf { public class PkiArchiveOptions @@ -19,7 +21,7 @@ namespace Org.BouncyCastle.Asn1.Crmf if (obj is Asn1TaggedObject) return new PkiArchiveOptions((Asn1TaggedObject)obj); - throw new ArgumentException("Invalid object: " + obj.GetType().Name, "obj"); + throw new ArgumentException("Invalid object: " + Platform.GetTypeName(obj), "obj"); } private PkiArchiveOptions(Asn1TaggedObject tagged) diff --git a/crypto/src/asn1/crmf/PKIPublicationInfo.cs b/crypto/src/asn1/crmf/PKIPublicationInfo.cs index c8bc1403e..a7d2bc603 100644 --- a/crypto/src/asn1/crmf/PKIPublicationInfo.cs +++ b/crypto/src/asn1/crmf/PKIPublicationInfo.cs @@ -1,5 +1,7 @@ using System; +using Org.BouncyCastle.Utilities; + namespace Org.BouncyCastle.Asn1.Crmf { public class PkiPublicationInfo @@ -22,7 +24,7 @@ namespace Org.BouncyCastle.Asn1.Crmf if (obj is Asn1Sequence) return new PkiPublicationInfo((Asn1Sequence)obj); - throw new ArgumentException("Invalid object: " + obj.GetType().Name, "obj"); + throw new ArgumentException("Invalid object: " + Platform.GetTypeName(obj), "obj"); } public virtual DerInteger Action diff --git a/crypto/src/asn1/crmf/PKMacValue.cs b/crypto/src/asn1/crmf/PKMacValue.cs index 20a08fd1d..e104c08dd 100644 --- a/crypto/src/asn1/crmf/PKMacValue.cs +++ b/crypto/src/asn1/crmf/PKMacValue.cs @@ -2,6 +2,7 @@ using Org.BouncyCastle.Asn1.Cmp; using Org.BouncyCastle.Asn1.X509; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Asn1.Crmf { @@ -28,7 +29,7 @@ namespace Org.BouncyCastle.Asn1.Crmf if (obj is Asn1Sequence) return new PKMacValue((Asn1Sequence)obj); - throw new ArgumentException("Invalid object: " + obj.GetType().Name, "obj"); + throw new ArgumentException("Invalid object: " + Platform.GetTypeName(obj), "obj"); } public static PKMacValue GetInstance(Asn1TaggedObject obj, bool isExplicit) diff --git a/crypto/src/asn1/crmf/PopoSigningKey.cs b/crypto/src/asn1/crmf/PopoSigningKey.cs index 614278eda..1c24db8ee 100644 --- a/crypto/src/asn1/crmf/PopoSigningKey.cs +++ b/crypto/src/asn1/crmf/PopoSigningKey.cs @@ -1,6 +1,7 @@ using System; using Org.BouncyCastle.Asn1.X509; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Asn1.Crmf { @@ -37,7 +38,7 @@ namespace Org.BouncyCastle.Asn1.Crmf if (obj is Asn1Sequence) return new PopoSigningKey((Asn1Sequence)obj); - throw new ArgumentException("Invalid object: " + obj.GetType().Name, "obj"); + throw new ArgumentException("Invalid object: " + Platform.GetTypeName(obj), "obj"); } public static PopoSigningKey GetInstance(Asn1TaggedObject obj, bool isExplicit) diff --git a/crypto/src/asn1/crmf/PopoSigningKeyInput.cs b/crypto/src/asn1/crmf/PopoSigningKeyInput.cs index 63695262f..e43fa138e 100644 --- a/crypto/src/asn1/crmf/PopoSigningKeyInput.cs +++ b/crypto/src/asn1/crmf/PopoSigningKeyInput.cs @@ -1,6 +1,7 @@ using System; using Org.BouncyCastle.Asn1.X509; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Asn1.Crmf { @@ -40,7 +41,7 @@ namespace Org.BouncyCastle.Asn1.Crmf if (obj is Asn1Sequence) return new PopoSigningKeyInput((Asn1Sequence)obj); - throw new ArgumentException("Invalid object: " + obj.GetType().Name, "obj"); + throw new ArgumentException("Invalid object: " + Platform.GetTypeName(obj), "obj"); } /** Creates a new PopoSigningKeyInput with sender name as authInfo. */ diff --git a/crypto/src/asn1/crmf/ProofOfPossession.cs b/crypto/src/asn1/crmf/ProofOfPossession.cs index fc00edb32..8957169d7 100644 --- a/crypto/src/asn1/crmf/ProofOfPossession.cs +++ b/crypto/src/asn1/crmf/ProofOfPossession.cs @@ -1,5 +1,7 @@ using System; +using Org.BouncyCastle.Utilities; + namespace Org.BouncyCastle.Asn1.Crmf { public class ProofOfPossession @@ -41,7 +43,7 @@ namespace Org.BouncyCastle.Asn1.Crmf if (obj is Asn1TaggedObject) return new ProofOfPossession((Asn1TaggedObject)obj); - throw new ArgumentException("Invalid object: " + obj.GetType().Name, "obj"); + throw new ArgumentException("Invalid object: " + Platform.GetTypeName(obj), "obj"); } /** Creates a ProofOfPossession with type raVerified. */ diff --git a/crypto/src/asn1/crmf/SinglePubInfo.cs b/crypto/src/asn1/crmf/SinglePubInfo.cs index eaf8a3efd..5205ce366 100644 --- a/crypto/src/asn1/crmf/SinglePubInfo.cs +++ b/crypto/src/asn1/crmf/SinglePubInfo.cs @@ -1,6 +1,7 @@ using System; using Org.BouncyCastle.Asn1.X509; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Asn1.Crmf { @@ -28,7 +29,7 @@ namespace Org.BouncyCastle.Asn1.Crmf if (obj is Asn1Sequence) return new SinglePubInfo((Asn1Sequence)obj); - throw new ArgumentException("Invalid object: " + obj.GetType().Name, "obj"); + throw new ArgumentException("Invalid object: " + Platform.GetTypeName(obj), "obj"); } public virtual GeneralName PubLocation diff --git a/crypto/src/asn1/cryptopro/ECGOST3410ParamSetParameters.cs b/crypto/src/asn1/cryptopro/ECGOST3410ParamSetParameters.cs index 6f4435d7b..8e568a229 100644 --- a/crypto/src/asn1/cryptopro/ECGOST3410ParamSetParameters.cs +++ b/crypto/src/asn1/cryptopro/ECGOST3410ParamSetParameters.cs @@ -2,6 +2,7 @@ using System; using System.Collections; using Org.BouncyCastle.Math; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Asn1.CryptoPro { @@ -30,7 +31,7 @@ namespace Org.BouncyCastle.Asn1.CryptoPro return new ECGost3410ParamSetParameters((Asn1Sequence) obj); } - throw new ArgumentException("Invalid GOST3410Parameter: " + obj.GetType().Name); + throw new ArgumentException("Invalid GOST3410Parameter: " + Platform.GetTypeName(obj)); } public ECGost3410ParamSetParameters( diff --git a/crypto/src/asn1/cryptopro/GOST28147Parameters.cs b/crypto/src/asn1/cryptopro/GOST28147Parameters.cs index eb7e0e3f6..fc0d792d1 100644 --- a/crypto/src/asn1/cryptopro/GOST28147Parameters.cs +++ b/crypto/src/asn1/cryptopro/GOST28147Parameters.cs @@ -1,7 +1,7 @@ using System; using System.Collections; -using Org.BouncyCastle.Asn1; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Asn1.CryptoPro { @@ -31,7 +31,7 @@ namespace Org.BouncyCastle.Asn1.CryptoPro return new Gost28147Parameters((Asn1Sequence) obj); } - throw new ArgumentException("Invalid GOST3410Parameter: " + obj.GetType().Name); + throw new ArgumentException("Invalid GOST3410Parameter: " + Platform.GetTypeName(obj)); } private Gost28147Parameters( diff --git a/crypto/src/asn1/cryptopro/GOST3410ParamSetParameters.cs b/crypto/src/asn1/cryptopro/GOST3410ParamSetParameters.cs index f133cdf1b..b347f8dbd 100644 --- a/crypto/src/asn1/cryptopro/GOST3410ParamSetParameters.cs +++ b/crypto/src/asn1/cryptopro/GOST3410ParamSetParameters.cs @@ -1,8 +1,8 @@ using System; using System.Collections; -using Org.BouncyCastle.Asn1; using Org.BouncyCastle.Math; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Asn1.CryptoPro { @@ -32,7 +32,7 @@ namespace Org.BouncyCastle.Asn1.CryptoPro return new Gost3410ParamSetParameters((Asn1Sequence) obj); } - throw new ArgumentException("Invalid GOST3410Parameter: " + obj.GetType().Name); + throw new ArgumentException("Invalid GOST3410Parameter: " + Platform.GetTypeName(obj)); } public Gost3410ParamSetParameters( diff --git a/crypto/src/asn1/cryptopro/GOST3410PublicKeyAlgParameters.cs b/crypto/src/asn1/cryptopro/GOST3410PublicKeyAlgParameters.cs index 8bc1460af..10c45ba4d 100644 --- a/crypto/src/asn1/cryptopro/GOST3410PublicKeyAlgParameters.cs +++ b/crypto/src/asn1/cryptopro/GOST3410PublicKeyAlgParameters.cs @@ -1,6 +1,6 @@ using System; -using Org.BouncyCastle.Asn1; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Asn1.CryptoPro { @@ -31,7 +31,7 @@ namespace Org.BouncyCastle.Asn1.CryptoPro return new Gost3410PublicKeyAlgParameters((Asn1Sequence) obj); } - throw new ArgumentException("Invalid GOST3410Parameter: " + obj.GetType().Name); + throw new ArgumentException("Invalid GOST3410Parameter: " + Platform.GetTypeName(obj)); } public Gost3410PublicKeyAlgParameters( diff --git a/crypto/src/asn1/esf/CertificateValues.cs b/crypto/src/asn1/esf/CertificateValues.cs index e0fb39b83..30a719177 100644 --- a/crypto/src/asn1/esf/CertificateValues.cs +++ b/crypto/src/asn1/esf/CertificateValues.cs @@ -2,6 +2,7 @@ using System; using System.Collections; using Org.BouncyCastle.Asn1.X509; +using Org.BouncyCastle.Utilities; using Org.BouncyCastle.Utilities.Collections; namespace Org.BouncyCastle.Asn1.Esf @@ -28,7 +29,7 @@ namespace Org.BouncyCastle.Asn1.Esf throw new ArgumentException( "Unknown object in 'CertificateValues' factory: " - + obj.GetType().Name, + + Platform.GetTypeName(obj), "obj"); } diff --git a/crypto/src/asn1/esf/CommitmentTypeIndication.cs b/crypto/src/asn1/esf/CommitmentTypeIndication.cs index 8342cbf8d..196a613a6 100644 --- a/crypto/src/asn1/esf/CommitmentTypeIndication.cs +++ b/crypto/src/asn1/esf/CommitmentTypeIndication.cs @@ -1,6 +1,6 @@ using System; -using Org.BouncyCastle.Asn1; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Asn1.Esf { @@ -21,7 +21,7 @@ namespace Org.BouncyCastle.Asn1.Esf throw new ArgumentException( "Unknown object in 'CommitmentTypeIndication' factory: " - + obj.GetType().Name, + + Platform.GetTypeName(obj), "obj"); } diff --git a/crypto/src/asn1/esf/CommitmentTypeQualifier.cs b/crypto/src/asn1/esf/CommitmentTypeQualifier.cs index 09ff70714..30bf0edfc 100644 --- a/crypto/src/asn1/esf/CommitmentTypeQualifier.cs +++ b/crypto/src/asn1/esf/CommitmentTypeQualifier.cs @@ -1,6 +1,6 @@ using System; -using Org.BouncyCastle.Asn1; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Asn1.Esf { @@ -84,7 +84,7 @@ namespace Org.BouncyCastle.Asn1.Esf throw new ArgumentException( "Unknown object in 'CommitmentTypeQualifier' factory: " - + obj.GetType().Name, + + Platform.GetTypeName(obj), "obj"); } diff --git a/crypto/src/asn1/esf/CompleteCertificateRefs.cs b/crypto/src/asn1/esf/CompleteCertificateRefs.cs index 7f1c835c9..af93700be 100644 --- a/crypto/src/asn1/esf/CompleteCertificateRefs.cs +++ b/crypto/src/asn1/esf/CompleteCertificateRefs.cs @@ -1,6 +1,7 @@ using System; using System.Collections; +using Org.BouncyCastle.Utilities; using Org.BouncyCastle.Utilities.Collections; namespace Org.BouncyCastle.Asn1.Esf @@ -27,7 +28,7 @@ namespace Org.BouncyCastle.Asn1.Esf throw new ArgumentException( "Unknown object in 'CompleteCertificateRefs' factory: " - + obj.GetType().Name, + + Platform.GetTypeName(obj), "obj"); } diff --git a/crypto/src/asn1/esf/CompleteRevocationRefs.cs b/crypto/src/asn1/esf/CompleteRevocationRefs.cs index 4e1fb403d..348e63fdb 100644 --- a/crypto/src/asn1/esf/CompleteRevocationRefs.cs +++ b/crypto/src/asn1/esf/CompleteRevocationRefs.cs @@ -1,6 +1,7 @@ using System; using System.Collections; +using Org.BouncyCastle.Utilities; using Org.BouncyCastle.Utilities.Collections; namespace Org.BouncyCastle.Asn1.Esf @@ -27,7 +28,7 @@ namespace Org.BouncyCastle.Asn1.Esf throw new ArgumentException( "Unknown object in 'CompleteRevocationRefs' factory: " - + obj.GetType().Name, + + Platform.GetTypeName(obj), "obj"); } diff --git a/crypto/src/asn1/esf/CrlIdentifier.cs b/crypto/src/asn1/esf/CrlIdentifier.cs index dfff7d838..96b50e211 100644 --- a/crypto/src/asn1/esf/CrlIdentifier.cs +++ b/crypto/src/asn1/esf/CrlIdentifier.cs @@ -2,6 +2,7 @@ using System; using Org.BouncyCastle.Asn1.X509; using Org.BouncyCastle.Math; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Asn1.Esf { @@ -34,7 +35,7 @@ namespace Org.BouncyCastle.Asn1.Esf throw new ArgumentException( "Unknown object in 'CrlIdentifier' factory: " - + obj.GetType().Name, + + Platform.GetTypeName(obj), "obj"); } diff --git a/crypto/src/asn1/esf/CrlListID.cs b/crypto/src/asn1/esf/CrlListID.cs index 2aae9b965..fbd4fb27c 100644 --- a/crypto/src/asn1/esf/CrlListID.cs +++ b/crypto/src/asn1/esf/CrlListID.cs @@ -1,6 +1,7 @@ using System; using System.Collections; +using Org.BouncyCastle.Utilities; using Org.BouncyCastle.Utilities.Collections; namespace Org.BouncyCastle.Asn1.Esf @@ -30,7 +31,7 @@ namespace Org.BouncyCastle.Asn1.Esf throw new ArgumentException( "Unknown object in 'CrlListID' factory: " - + obj.GetType().Name, + + Platform.GetTypeName(obj), "obj"); } diff --git a/crypto/src/asn1/esf/CrlOcspRef.cs b/crypto/src/asn1/esf/CrlOcspRef.cs index c8e10d504..6153e0c53 100644 --- a/crypto/src/asn1/esf/CrlOcspRef.cs +++ b/crypto/src/asn1/esf/CrlOcspRef.cs @@ -1,5 +1,7 @@ using System; +using Org.BouncyCastle.Utilities; + namespace Org.BouncyCastle.Asn1.Esf { /// <remarks> @@ -30,7 +32,7 @@ namespace Org.BouncyCastle.Asn1.Esf throw new ArgumentException( "Unknown object in 'CrlOcspRef' factory: " - + obj.GetType().Name, + + Platform.GetTypeName(obj), "obj"); } diff --git a/crypto/src/asn1/esf/CrlValidatedID.cs b/crypto/src/asn1/esf/CrlValidatedID.cs index 165f547a8..e8cd17a19 100644 --- a/crypto/src/asn1/esf/CrlValidatedID.cs +++ b/crypto/src/asn1/esf/CrlValidatedID.cs @@ -1,5 +1,7 @@ using System; +using Org.BouncyCastle.Utilities; + namespace Org.BouncyCastle.Asn1.Esf { /// <remarks> @@ -27,7 +29,7 @@ namespace Org.BouncyCastle.Asn1.Esf throw new ArgumentException( "Unknown object in 'CrlValidatedID' factory: " - + obj.GetType().Name, + + Platform.GetTypeName(obj), "obj"); } diff --git a/crypto/src/asn1/esf/OcspIdentifier.cs b/crypto/src/asn1/esf/OcspIdentifier.cs index 949b68243..e65f1cfe7 100644 --- a/crypto/src/asn1/esf/OcspIdentifier.cs +++ b/crypto/src/asn1/esf/OcspIdentifier.cs @@ -1,6 +1,7 @@ using System; using Org.BouncyCastle.Asn1.Ocsp; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Asn1.Esf { @@ -32,7 +33,7 @@ namespace Org.BouncyCastle.Asn1.Esf throw new ArgumentException( "Unknown object in 'OcspIdentifier' factory: " - + obj.GetType().Name, + + Platform.GetTypeName(obj), "obj"); } diff --git a/crypto/src/asn1/esf/OcspListID.cs b/crypto/src/asn1/esf/OcspListID.cs index 1f3f3a337..1c8edb16b 100644 --- a/crypto/src/asn1/esf/OcspListID.cs +++ b/crypto/src/asn1/esf/OcspListID.cs @@ -1,6 +1,7 @@ using System; using System.Collections; +using Org.BouncyCastle.Utilities; using Org.BouncyCastle.Utilities.Collections; namespace Org.BouncyCastle.Asn1.Esf @@ -29,7 +30,7 @@ namespace Org.BouncyCastle.Asn1.Esf throw new ArgumentException( "Unknown object in 'OcspListID' factory: " - + obj.GetType().Name, + + Platform.GetTypeName(obj), "obj"); } diff --git a/crypto/src/asn1/esf/OcspResponsesID.cs b/crypto/src/asn1/esf/OcspResponsesID.cs index e09508a01..8718188fc 100644 --- a/crypto/src/asn1/esf/OcspResponsesID.cs +++ b/crypto/src/asn1/esf/OcspResponsesID.cs @@ -1,5 +1,7 @@ using System; +using Org.BouncyCastle.Utilities; + namespace Org.BouncyCastle.Asn1.Esf { /// <remarks> @@ -28,7 +30,7 @@ namespace Org.BouncyCastle.Asn1.Esf throw new ArgumentException( "Unknown object in 'OcspResponsesID' factory: " - + obj.GetType().Name, + + Platform.GetTypeName(obj), "obj"); } diff --git a/crypto/src/asn1/esf/OtherCertID.cs b/crypto/src/asn1/esf/OtherCertID.cs index 6d1255535..19d173aa2 100644 --- a/crypto/src/asn1/esf/OtherCertID.cs +++ b/crypto/src/asn1/esf/OtherCertID.cs @@ -1,6 +1,7 @@ using System; using Org.BouncyCastle.Asn1.X509; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Asn1.Esf { @@ -29,7 +30,7 @@ namespace Org.BouncyCastle.Asn1.Esf throw new ArgumentException( "Unknown object in 'OtherCertID' factory: " - + obj.GetType().Name, + + Platform.GetTypeName(obj), "obj"); } diff --git a/crypto/src/asn1/esf/OtherHashAlgAndValue.cs b/crypto/src/asn1/esf/OtherHashAlgAndValue.cs index b6bd4f498..00eb24c54 100644 --- a/crypto/src/asn1/esf/OtherHashAlgAndValue.cs +++ b/crypto/src/asn1/esf/OtherHashAlgAndValue.cs @@ -1,6 +1,7 @@ using System; using Org.BouncyCastle.Asn1.X509; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Asn1.Esf { @@ -34,7 +35,7 @@ namespace Org.BouncyCastle.Asn1.Esf throw new ArgumentException( "Unknown object in 'OtherHashAlgAndValue' factory: " - + obj.GetType().Name, + + Platform.GetTypeName(obj), "obj"); } diff --git a/crypto/src/asn1/esf/OtherRevRefs.cs b/crypto/src/asn1/esf/OtherRevRefs.cs index 56713e3f2..446031e5a 100644 --- a/crypto/src/asn1/esf/OtherRevRefs.cs +++ b/crypto/src/asn1/esf/OtherRevRefs.cs @@ -1,5 +1,7 @@ using System; +using Org.BouncyCastle.Utilities; + namespace Org.BouncyCastle.Asn1.Esf { /// <remarks> @@ -31,7 +33,7 @@ namespace Org.BouncyCastle.Asn1.Esf throw new ArgumentException( "Unknown object in 'OtherRevRefs' factory: " - + obj.GetType().Name, + + Platform.GetTypeName(obj), "obj"); } diff --git a/crypto/src/asn1/esf/OtherRevVals.cs b/crypto/src/asn1/esf/OtherRevVals.cs index b88a1a72a..7b904565a 100644 --- a/crypto/src/asn1/esf/OtherRevVals.cs +++ b/crypto/src/asn1/esf/OtherRevVals.cs @@ -1,5 +1,7 @@ using System; +using Org.BouncyCastle.Utilities; + namespace Org.BouncyCastle.Asn1.Esf { /// <remarks> @@ -31,7 +33,7 @@ namespace Org.BouncyCastle.Asn1.Esf throw new ArgumentException( "Unknown object in 'OtherRevVals' factory: " - + obj.GetType().Name, + + Platform.GetTypeName(obj), "obj"); } diff --git a/crypto/src/asn1/esf/OtherSigningCertificate.cs b/crypto/src/asn1/esf/OtherSigningCertificate.cs index 90e385a33..f7b9f5e66 100644 --- a/crypto/src/asn1/esf/OtherSigningCertificate.cs +++ b/crypto/src/asn1/esf/OtherSigningCertificate.cs @@ -2,6 +2,7 @@ using System; using System.Collections; using Org.BouncyCastle.Asn1.X509; +using Org.BouncyCastle.Utilities; using Org.BouncyCastle.Utilities.Collections; namespace Org.BouncyCastle.Asn1.Esf @@ -31,7 +32,7 @@ namespace Org.BouncyCastle.Asn1.Esf throw new ArgumentException( "Unknown object in 'OtherSigningCertificate' factory: " - + obj.GetType().Name, + + Platform.GetTypeName(obj), "obj"); } diff --git a/crypto/src/asn1/esf/SigPolicyQualifierInfo.cs b/crypto/src/asn1/esf/SigPolicyQualifierInfo.cs index 2d36bc751..470c5c873 100644 --- a/crypto/src/asn1/esf/SigPolicyQualifierInfo.cs +++ b/crypto/src/asn1/esf/SigPolicyQualifierInfo.cs @@ -1,5 +1,7 @@ using System; +using Org.BouncyCastle.Utilities; + namespace Org.BouncyCastle.Asn1.Esf { /// <remarks> @@ -29,7 +31,7 @@ namespace Org.BouncyCastle.Asn1.Esf throw new ArgumentException( "Unknown object in 'SigPolicyQualifierInfo' factory: " - + obj.GetType().Name, + + Platform.GetTypeName(obj), "obj"); } diff --git a/crypto/src/asn1/esf/SignaturePolicyId.cs b/crypto/src/asn1/esf/SignaturePolicyId.cs index 545be2cf4..7146bb4c1 100644 --- a/crypto/src/asn1/esf/SignaturePolicyId.cs +++ b/crypto/src/asn1/esf/SignaturePolicyId.cs @@ -1,6 +1,7 @@ using System; using System.Collections; +using Org.BouncyCastle.Utilities; using Org.BouncyCastle.Utilities.Collections; namespace Org.BouncyCastle.Asn1.Esf @@ -36,7 +37,7 @@ namespace Org.BouncyCastle.Asn1.Esf throw new ArgumentException( "Unknown object in 'SignaturePolicyId' factory: " - + obj.GetType().Name, + + Platform.GetTypeName(obj), "obj"); } diff --git a/crypto/src/asn1/esf/SignaturePolicyIdentifier.cs b/crypto/src/asn1/esf/SignaturePolicyIdentifier.cs index 3a639f444..12257f2f0 100644 --- a/crypto/src/asn1/esf/SignaturePolicyIdentifier.cs +++ b/crypto/src/asn1/esf/SignaturePolicyIdentifier.cs @@ -1,5 +1,7 @@ using System; +using Org.BouncyCastle.Utilities; + namespace Org.BouncyCastle.Asn1.Esf { /// <remarks> @@ -31,7 +33,7 @@ namespace Org.BouncyCastle.Asn1.Esf throw new ArgumentException( "Unknown object in 'SignaturePolicyIdentifier' factory: " - + obj.GetType().Name, + + Platform.GetTypeName(obj), "obj"); } diff --git a/crypto/src/asn1/esf/SignerAttribute.cs b/crypto/src/asn1/esf/SignerAttribute.cs index ddee53c69..39bd910b2 100644 --- a/crypto/src/asn1/esf/SignerAttribute.cs +++ b/crypto/src/asn1/esf/SignerAttribute.cs @@ -1,6 +1,7 @@ using System; using Org.BouncyCastle.Asn1.X509; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Asn1.Esf { @@ -21,7 +22,7 @@ namespace Org.BouncyCastle.Asn1.Esf throw new ArgumentException( "Unknown object in 'SignerAttribute' factory: " - + obj.GetType().Name, + + Platform.GetTypeName(obj), "obj"); } diff --git a/crypto/src/asn1/ess/ContentHints.cs b/crypto/src/asn1/ess/ContentHints.cs index a430fea8d..cfd174b3a 100644 --- a/crypto/src/asn1/ess/ContentHints.cs +++ b/crypto/src/asn1/ess/ContentHints.cs @@ -1,5 +1,7 @@ using System; +using Org.BouncyCastle.Utilities; + namespace Org.BouncyCastle.Asn1.Ess { public class ContentHints @@ -22,7 +24,7 @@ namespace Org.BouncyCastle.Asn1.Ess } throw new ArgumentException("unknown object in 'ContentHints' factory : " - + o.GetType().Name + "."); + + Platform.GetTypeName(o) + "."); } /** diff --git a/crypto/src/asn1/ess/ContentIdentifier.cs b/crypto/src/asn1/ess/ContentIdentifier.cs index 8058dcc53..430185e11 100644 --- a/crypto/src/asn1/ess/ContentIdentifier.cs +++ b/crypto/src/asn1/ess/ContentIdentifier.cs @@ -1,5 +1,7 @@ using System; +using Org.BouncyCastle.Utilities; + namespace Org.BouncyCastle.Asn1.Ess { public class ContentIdentifier @@ -22,7 +24,7 @@ namespace Org.BouncyCastle.Asn1.Ess throw new ArgumentException( "unknown object in 'ContentIdentifier' factory : " - + o.GetType().Name + "."); + + Platform.GetTypeName(o) + "."); } /** diff --git a/crypto/src/asn1/ess/ESSCertID.cs b/crypto/src/asn1/ess/ESSCertID.cs index 4d449a746..b4465ea4f 100644 --- a/crypto/src/asn1/ess/ESSCertID.cs +++ b/crypto/src/asn1/ess/ESSCertID.cs @@ -1,6 +1,7 @@ using System; using Org.BouncyCastle.Asn1.X509; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Asn1.Ess { @@ -25,7 +26,7 @@ namespace Org.BouncyCastle.Asn1.Ess throw new ArgumentException( "unknown object in 'EssCertID' factory : " - + o.GetType().Name + "."); + + Platform.GetTypeName(o) + "."); } /** diff --git a/crypto/src/asn1/ess/OtherCertID.cs b/crypto/src/asn1/ess/OtherCertID.cs index 3d221b0ec..7794c81fa 100644 --- a/crypto/src/asn1/ess/OtherCertID.cs +++ b/crypto/src/asn1/ess/OtherCertID.cs @@ -2,6 +2,7 @@ using System; using Org.BouncyCastle.Asn1.Oiw; using Org.BouncyCastle.Asn1.X509; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Asn1.Ess { @@ -27,7 +28,7 @@ namespace Org.BouncyCastle.Asn1.Ess throw new ArgumentException( "unknown object in 'OtherCertID' factory : " - + o.GetType().Name + "."); + + Platform.GetTypeName(o) + "."); } /** diff --git a/crypto/src/asn1/ess/OtherSigningCertificate.cs b/crypto/src/asn1/ess/OtherSigningCertificate.cs index c165fecea..6cef92b62 100644 --- a/crypto/src/asn1/ess/OtherSigningCertificate.cs +++ b/crypto/src/asn1/ess/OtherSigningCertificate.cs @@ -1,6 +1,7 @@ using System; using Org.BouncyCastle.Asn1.X509; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Asn1.Ess { @@ -25,7 +26,7 @@ namespace Org.BouncyCastle.Asn1.Ess throw new ArgumentException( "unknown object in 'OtherSigningCertificate' factory : " - + o.GetType().Name + "."); + + Platform.GetTypeName(o) + "."); } /** diff --git a/crypto/src/asn1/ess/SigningCertificate.cs b/crypto/src/asn1/ess/SigningCertificate.cs index 366749bc3..51f67c1ff 100644 --- a/crypto/src/asn1/ess/SigningCertificate.cs +++ b/crypto/src/asn1/ess/SigningCertificate.cs @@ -1,6 +1,7 @@ using System; using Org.BouncyCastle.Asn1.X509; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Asn1.Ess { @@ -24,7 +25,7 @@ namespace Org.BouncyCastle.Asn1.Ess throw new ArgumentException( "unknown object in 'SigningCertificate' factory : " - + o.GetType().Name + "."); + + Platform.GetTypeName(o) + "."); } /** diff --git a/crypto/src/asn1/ess/SigningCertificateV2.cs b/crypto/src/asn1/ess/SigningCertificateV2.cs index cabecc1ba..91eda9e33 100644 --- a/crypto/src/asn1/ess/SigningCertificateV2.cs +++ b/crypto/src/asn1/ess/SigningCertificateV2.cs @@ -1,6 +1,7 @@ using System; using Org.BouncyCastle.Asn1.X509; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Asn1.Ess { @@ -21,7 +22,7 @@ namespace Org.BouncyCastle.Asn1.Ess throw new ArgumentException( "unknown object in 'SigningCertificateV2' factory : " - + o.GetType().Name + "."); + + Platform.GetTypeName(o) + "."); } private SigningCertificateV2( diff --git a/crypto/src/asn1/isismtt/ocsp/CertHash.cs b/crypto/src/asn1/isismtt/ocsp/CertHash.cs index da5b530e4..5773e1c56 100644 --- a/crypto/src/asn1/isismtt/ocsp/CertHash.cs +++ b/crypto/src/asn1/isismtt/ocsp/CertHash.cs @@ -1,6 +1,7 @@ using System; using Org.BouncyCastle.Asn1.X509; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Asn1.IsisMtt.Ocsp { @@ -43,7 +44,7 @@ namespace Org.BouncyCastle.Asn1.IsisMtt.Ocsp return new CertHash((Asn1Sequence) obj); } - throw new ArgumentException("unknown object in factory: " + obj.GetType().Name, "obj"); + throw new ArgumentException("unknown object in factory: " + Platform.GetTypeName(obj), "obj"); } /** diff --git a/crypto/src/asn1/isismtt/ocsp/RequestedCertificate.cs b/crypto/src/asn1/isismtt/ocsp/RequestedCertificate.cs index 7724bfed6..413b3bd7f 100644 --- a/crypto/src/asn1/isismtt/ocsp/RequestedCertificate.cs +++ b/crypto/src/asn1/isismtt/ocsp/RequestedCertificate.cs @@ -1,6 +1,8 @@ using System; using System.IO; + using Org.BouncyCastle.Asn1.X509; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Asn1.IsisMtt.Ocsp { @@ -69,7 +71,7 @@ namespace Org.BouncyCastle.Asn1.IsisMtt.Ocsp return new RequestedCertificate((Asn1TaggedObject) obj); } - throw new ArgumentException("unknown object in factory: " + obj.GetType().Name, "obj"); + throw new ArgumentException("unknown object in factory: " + Platform.GetTypeName(obj), "obj"); } public static RequestedCertificate GetInstance( diff --git a/crypto/src/asn1/isismtt/x509/AdditionalInformationSyntax.cs b/crypto/src/asn1/isismtt/x509/AdditionalInformationSyntax.cs index f81d459c6..53a8e98a7 100644 --- a/crypto/src/asn1/isismtt/x509/AdditionalInformationSyntax.cs +++ b/crypto/src/asn1/isismtt/x509/AdditionalInformationSyntax.cs @@ -1,6 +1,7 @@ using System; using Org.BouncyCastle.Asn1.X500; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Asn1.IsisMtt.X509 { @@ -26,7 +27,7 @@ namespace Org.BouncyCastle.Asn1.IsisMtt.X509 if (obj is IAsn1String) return new AdditionalInformationSyntax(DirectoryString.GetInstance(obj)); - throw new ArgumentException("Unknown object in GetInstance: " + obj.GetType().Name, "obj"); + throw new ArgumentException("Unknown object in GetInstance: " + Platform.GetTypeName(obj), "obj"); } private AdditionalInformationSyntax( diff --git a/crypto/src/asn1/isismtt/x509/AdmissionSyntax.cs b/crypto/src/asn1/isismtt/x509/AdmissionSyntax.cs index 64b5dbec8..4b6264ae0 100644 --- a/crypto/src/asn1/isismtt/x509/AdmissionSyntax.cs +++ b/crypto/src/asn1/isismtt/x509/AdmissionSyntax.cs @@ -1,6 +1,7 @@ using System; using Org.BouncyCastle.Asn1.X509; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Asn1.IsisMtt.X509 { @@ -130,7 +131,7 @@ namespace Org.BouncyCastle.Asn1.IsisMtt.X509 return new AdmissionSyntax((Asn1Sequence)obj); } - throw new ArgumentException("unknown object in factory: " + obj.GetType().Name, "obj"); + throw new ArgumentException("unknown object in factory: " + Platform.GetTypeName(obj), "obj"); } /** diff --git a/crypto/src/asn1/isismtt/x509/Admissions.cs b/crypto/src/asn1/isismtt/x509/Admissions.cs index 40290c608..e914db0b5 100644 --- a/crypto/src/asn1/isismtt/x509/Admissions.cs +++ b/crypto/src/asn1/isismtt/x509/Admissions.cs @@ -2,6 +2,7 @@ using System; using System.Collections; using Org.BouncyCastle.Asn1.X509; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Asn1.IsisMtt.X509 { @@ -42,7 +43,7 @@ namespace Org.BouncyCastle.Asn1.IsisMtt.X509 return new Admissions((Asn1Sequence) obj); } - throw new ArgumentException("unknown object in factory: " + obj.GetType().Name, "obj"); + throw new ArgumentException("unknown object in factory: " + Platform.GetTypeName(obj), "obj"); } /** @@ -103,7 +104,7 @@ namespace Org.BouncyCastle.Asn1.IsisMtt.X509 professionInfos = Asn1Sequence.GetInstance(o); if (e.MoveNext()) { - throw new ArgumentException("Bad object encountered: " + e.Current.GetType().Name); + throw new ArgumentException("Bad object encountered: " + Platform.GetTypeName(e.Current)); } } diff --git a/crypto/src/asn1/isismtt/x509/DeclarationOfMajority.cs b/crypto/src/asn1/isismtt/x509/DeclarationOfMajority.cs index dfac65040..c4ebb2b72 100644 --- a/crypto/src/asn1/isismtt/x509/DeclarationOfMajority.cs +++ b/crypto/src/asn1/isismtt/x509/DeclarationOfMajority.cs @@ -1,5 +1,7 @@ using System; +using Org.BouncyCastle.Utilities; + namespace Org.BouncyCastle.Asn1.IsisMtt.X509 { /** @@ -80,7 +82,7 @@ namespace Org.BouncyCastle.Asn1.IsisMtt.X509 return new DeclarationOfMajority((Asn1TaggedObject) obj); } - throw new ArgumentException("unknown object in factory: " + obj.GetType().Name, "obj"); + throw new ArgumentException("unknown object in factory: " + Platform.GetTypeName(obj), "obj"); } private DeclarationOfMajority( diff --git a/crypto/src/asn1/isismtt/x509/MonetaryLimit.cs b/crypto/src/asn1/isismtt/x509/MonetaryLimit.cs index 80b6b684b..b792fffda 100644 --- a/crypto/src/asn1/isismtt/x509/MonetaryLimit.cs +++ b/crypto/src/asn1/isismtt/x509/MonetaryLimit.cs @@ -1,6 +1,7 @@ using System; using Org.BouncyCastle.Math; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Asn1.IsisMtt.X509 { @@ -48,7 +49,7 @@ namespace Org.BouncyCastle.Asn1.IsisMtt.X509 return new MonetaryLimit(Asn1Sequence.GetInstance(obj)); } - throw new ArgumentException("unknown object in factory: " + obj.GetType().Name, "obj"); + throw new ArgumentException("unknown object in factory: " + Platform.GetTypeName(obj), "obj"); } private MonetaryLimit( diff --git a/crypto/src/asn1/isismtt/x509/NamingAuthority.cs b/crypto/src/asn1/isismtt/x509/NamingAuthority.cs index 4262fd0f4..35539f488 100644 --- a/crypto/src/asn1/isismtt/x509/NamingAuthority.cs +++ b/crypto/src/asn1/isismtt/x509/NamingAuthority.cs @@ -2,6 +2,7 @@ using System; using System.Collections; using Org.BouncyCastle.Asn1.X500; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Asn1.IsisMtt.X509 { @@ -49,7 +50,7 @@ namespace Org.BouncyCastle.Asn1.IsisMtt.X509 return new NamingAuthority((Asn1Sequence) obj); } - throw new ArgumentException("unknown object in factory: " + obj.GetType().Name, "obj"); + throw new ArgumentException("unknown object in factory: " + Platform.GetTypeName(obj), "obj"); } public static NamingAuthority GetInstance( @@ -99,7 +100,7 @@ namespace Org.BouncyCastle.Asn1.IsisMtt.X509 } else { - throw new ArgumentException("Bad object encountered: " + o.GetType().Name); + throw new ArgumentException("Bad object encountered: " + Platform.GetTypeName(o)); } } @@ -116,7 +117,7 @@ namespace Org.BouncyCastle.Asn1.IsisMtt.X509 } else { - throw new ArgumentException("Bad object encountered: " + o.GetType().Name); + throw new ArgumentException("Bad object encountered: " + Platform.GetTypeName(o)); } } @@ -129,7 +130,7 @@ namespace Org.BouncyCastle.Asn1.IsisMtt.X509 } else { - throw new ArgumentException("Bad object encountered: " + o.GetType().Name); + throw new ArgumentException("Bad object encountered: " + Platform.GetTypeName(o)); } } } diff --git a/crypto/src/asn1/isismtt/x509/ProcurationSyntax.cs b/crypto/src/asn1/isismtt/x509/ProcurationSyntax.cs index a25df225e..f42364699 100644 --- a/crypto/src/asn1/isismtt/x509/ProcurationSyntax.cs +++ b/crypto/src/asn1/isismtt/x509/ProcurationSyntax.cs @@ -3,6 +3,7 @@ using System.Collections; using Org.BouncyCastle.Asn1.X500; using Org.BouncyCastle.Asn1.X509; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Asn1.IsisMtt.X509 { @@ -61,7 +62,7 @@ namespace Org.BouncyCastle.Asn1.IsisMtt.X509 return new ProcurationSyntax((Asn1Sequence) obj); } - throw new ArgumentException("unknown object in factory: " + obj.GetType().Name, "obj"); + throw new ArgumentException("unknown object in factory: " + Platform.GetTypeName(obj), "obj"); } /** diff --git a/crypto/src/asn1/isismtt/x509/ProfessionInfo.cs b/crypto/src/asn1/isismtt/x509/ProfessionInfo.cs index 3bad2cbc4..671a465af 100644 --- a/crypto/src/asn1/isismtt/x509/ProfessionInfo.cs +++ b/crypto/src/asn1/isismtt/x509/ProfessionInfo.cs @@ -2,6 +2,7 @@ using System; using System.Collections; using Org.BouncyCastle.Asn1.X500; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Asn1.IsisMtt.X509 { @@ -157,7 +158,7 @@ namespace Org.BouncyCastle.Asn1.IsisMtt.X509 return new ProfessionInfo((Asn1Sequence) obj); } - throw new ArgumentException("unknown object in factory: " + obj.GetType().Name, "obj"); + throw new ArgumentException("unknown object in factory: " + Platform.GetTypeName(obj), "obj"); } /** @@ -218,7 +219,7 @@ namespace Org.BouncyCastle.Asn1.IsisMtt.X509 } else { - throw new ArgumentException("Bad object encountered: " + o.GetType().Name); + throw new ArgumentException("Bad object encountered: " + Platform.GetTypeName(o)); } } @@ -235,7 +236,7 @@ namespace Org.BouncyCastle.Asn1.IsisMtt.X509 } else { - throw new ArgumentException("Bad object encountered: " + o.GetType().Name); + throw new ArgumentException("Bad object encountered: " + Platform.GetTypeName(o)); } } @@ -248,7 +249,7 @@ namespace Org.BouncyCastle.Asn1.IsisMtt.X509 } else { - throw new ArgumentException("Bad object encountered: " + o.GetType().Name); + throw new ArgumentException("Bad object encountered: " + Platform.GetTypeName(o)); } } } diff --git a/crypto/src/asn1/isismtt/x509/Restriction.cs b/crypto/src/asn1/isismtt/x509/Restriction.cs index c97766999..75df25201 100644 --- a/crypto/src/asn1/isismtt/x509/Restriction.cs +++ b/crypto/src/asn1/isismtt/x509/Restriction.cs @@ -1,6 +1,7 @@ using System; using Org.BouncyCastle.Asn1.X500; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Asn1.IsisMtt.X509 { @@ -25,7 +26,7 @@ namespace Org.BouncyCastle.Asn1.IsisMtt.X509 if (obj is IAsn1String) return new Restriction(DirectoryString.GetInstance(obj)); - throw new ArgumentException("Unknown object in GetInstance: " + obj.GetType().Name, "obj"); + throw new ArgumentException("Unknown object in GetInstance: " + Platform.GetTypeName(obj), "obj"); } /** diff --git a/crypto/src/asn1/mozilla/PublicKeyAndChallenge.cs b/crypto/src/asn1/mozilla/PublicKeyAndChallenge.cs index 1e08b809d..ff2a1199f 100644 --- a/crypto/src/asn1/mozilla/PublicKeyAndChallenge.cs +++ b/crypto/src/asn1/mozilla/PublicKeyAndChallenge.cs @@ -1,6 +1,7 @@ using System; using Org.BouncyCastle.Asn1.X509; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Asn1.Mozilla { @@ -38,7 +39,7 @@ namespace Org.BouncyCastle.Asn1.Mozilla throw new ArgumentException( "unknown object in 'PublicKeyAndChallenge' factory : " - + obj.GetType().Name + "."); + + Platform.GetTypeName(obj) + "."); } public PublicKeyAndChallenge( diff --git a/crypto/src/asn1/ocsp/BasicOCSPResponse.cs b/crypto/src/asn1/ocsp/BasicOCSPResponse.cs index 064335ae8..e6aa1f86b 100644 --- a/crypto/src/asn1/ocsp/BasicOCSPResponse.cs +++ b/crypto/src/asn1/ocsp/BasicOCSPResponse.cs @@ -2,6 +2,7 @@ using System; using Org.BouncyCastle.Asn1; using Org.BouncyCastle.Asn1.X509; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Asn1.Ocsp { @@ -33,7 +34,7 @@ namespace Org.BouncyCastle.Asn1.Ocsp return new BasicOcspResponse((Asn1Sequence)obj); } - throw new ArgumentException("unknown object in factory: " + obj.GetType().Name, "obj"); + throw new ArgumentException("unknown object in factory: " + Platform.GetTypeName(obj), "obj"); } public BasicOcspResponse( diff --git a/crypto/src/asn1/ocsp/CertID.cs b/crypto/src/asn1/ocsp/CertID.cs index 4b251095b..523f6b87c 100644 --- a/crypto/src/asn1/ocsp/CertID.cs +++ b/crypto/src/asn1/ocsp/CertID.cs @@ -2,6 +2,7 @@ using System; using Org.BouncyCastle.Asn1; using Org.BouncyCastle.Asn1.X509; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Asn1.Ocsp { @@ -33,7 +34,7 @@ namespace Org.BouncyCastle.Asn1.Ocsp return new CertID((Asn1Sequence)obj); } - throw new ArgumentException("unknown object in factory: " + obj.GetType().Name, "obj"); + throw new ArgumentException("unknown object in factory: " + Platform.GetTypeName(obj), "obj"); } public CertID( diff --git a/crypto/src/asn1/ocsp/CertStatus.cs b/crypto/src/asn1/ocsp/CertStatus.cs index d5b1a94a2..b524364c9 100644 --- a/crypto/src/asn1/ocsp/CertStatus.cs +++ b/crypto/src/asn1/ocsp/CertStatus.cs @@ -1,6 +1,6 @@ using System; -using Org.BouncyCastle.Asn1; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Asn1.Ocsp { @@ -64,7 +64,7 @@ namespace Org.BouncyCastle.Asn1.Ocsp return new CertStatus((Asn1TaggedObject)obj); } - throw new ArgumentException("unknown object in factory: " + obj.GetType().Name, "obj"); + throw new ArgumentException("unknown object in factory: " + Platform.GetTypeName(obj), "obj"); } public int TagNo diff --git a/crypto/src/asn1/ocsp/OCSPRequest.cs b/crypto/src/asn1/ocsp/OCSPRequest.cs index 1e804d78e..2407678b4 100644 --- a/crypto/src/asn1/ocsp/OCSPRequest.cs +++ b/crypto/src/asn1/ocsp/OCSPRequest.cs @@ -1,6 +1,6 @@ using System; -using Org.BouncyCastle.Asn1; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Asn1.Ocsp { @@ -30,7 +30,7 @@ namespace Org.BouncyCastle.Asn1.Ocsp return new OcspRequest((Asn1Sequence)obj); } - throw new ArgumentException("unknown object in factory: " + obj.GetType().Name, "obj"); + throw new ArgumentException("unknown object in factory: " + Platform.GetTypeName(obj), "obj"); } public OcspRequest( diff --git a/crypto/src/asn1/ocsp/OCSPResponse.cs b/crypto/src/asn1/ocsp/OCSPResponse.cs index e9aad8100..9477b61c0 100644 --- a/crypto/src/asn1/ocsp/OCSPResponse.cs +++ b/crypto/src/asn1/ocsp/OCSPResponse.cs @@ -1,6 +1,6 @@ using System; -using Org.BouncyCastle.Asn1; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Asn1.Ocsp { @@ -30,7 +30,7 @@ namespace Org.BouncyCastle.Asn1.Ocsp return new OcspResponse((Asn1Sequence)obj); } - throw new ArgumentException("unknown object in factory: " + obj.GetType().Name, "obj"); + throw new ArgumentException("unknown object in factory: " + Platform.GetTypeName(obj), "obj"); } public OcspResponse( diff --git a/crypto/src/asn1/ocsp/Request.cs b/crypto/src/asn1/ocsp/Request.cs index 116c15e73..26e81ba70 100644 --- a/crypto/src/asn1/ocsp/Request.cs +++ b/crypto/src/asn1/ocsp/Request.cs @@ -2,6 +2,7 @@ using System; using Org.BouncyCastle.Asn1; using Org.BouncyCastle.Asn1.X509; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Asn1.Ocsp { @@ -31,7 +32,7 @@ namespace Org.BouncyCastle.Asn1.Ocsp return new Request((Asn1Sequence)obj); } - throw new ArgumentException("unknown object in factory: " + obj.GetType().Name, "obj"); + throw new ArgumentException("unknown object in factory: " + Platform.GetTypeName(obj), "obj"); } public Request( diff --git a/crypto/src/asn1/ocsp/ResponseBytes.cs b/crypto/src/asn1/ocsp/ResponseBytes.cs index 2ce59faea..d3ea044bf 100644 --- a/crypto/src/asn1/ocsp/ResponseBytes.cs +++ b/crypto/src/asn1/ocsp/ResponseBytes.cs @@ -1,6 +1,6 @@ using System; -using Org.BouncyCastle.Asn1; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Asn1.Ocsp { @@ -30,7 +30,7 @@ namespace Org.BouncyCastle.Asn1.Ocsp return new ResponseBytes((Asn1Sequence)obj); } - throw new ArgumentException("unknown object in factory: " + obj.GetType().Name, "obj"); + throw new ArgumentException("unknown object in factory: " + Platform.GetTypeName(obj), "obj"); } public ResponseBytes( diff --git a/crypto/src/asn1/ocsp/ResponseData.cs b/crypto/src/asn1/ocsp/ResponseData.cs index 173829db8..70620cbc3 100644 --- a/crypto/src/asn1/ocsp/ResponseData.cs +++ b/crypto/src/asn1/ocsp/ResponseData.cs @@ -1,7 +1,7 @@ using System; -using Org.BouncyCastle.Asn1; using Org.BouncyCastle.Asn1.X509; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Asn1.Ocsp { @@ -37,7 +37,7 @@ namespace Org.BouncyCastle.Asn1.Ocsp return new ResponseData((Asn1Sequence)obj); } - throw new ArgumentException("unknown object in factory: " + obj.GetType().Name, "obj"); + throw new ArgumentException("unknown object in factory: " + Platform.GetTypeName(obj), "obj"); } public ResponseData( diff --git a/crypto/src/asn1/ocsp/RevokedInfo.cs b/crypto/src/asn1/ocsp/RevokedInfo.cs index 7d9d590e3..ee9e55429 100644 --- a/crypto/src/asn1/ocsp/RevokedInfo.cs +++ b/crypto/src/asn1/ocsp/RevokedInfo.cs @@ -1,7 +1,7 @@ using System; -using Org.BouncyCastle.Asn1; using Org.BouncyCastle.Asn1.X509; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Asn1.Ocsp { @@ -31,7 +31,7 @@ namespace Org.BouncyCastle.Asn1.Ocsp return new RevokedInfo((Asn1Sequence) obj); } - throw new ArgumentException("unknown object in factory: " + obj.GetType().Name, "obj"); + throw new ArgumentException("unknown object in factory: " + Platform.GetTypeName(obj), "obj"); } public RevokedInfo( diff --git a/crypto/src/asn1/ocsp/ServiceLocator.cs b/crypto/src/asn1/ocsp/ServiceLocator.cs index 56bc49ded..4ba252be3 100644 --- a/crypto/src/asn1/ocsp/ServiceLocator.cs +++ b/crypto/src/asn1/ocsp/ServiceLocator.cs @@ -1,7 +1,7 @@ using System; -using Org.BouncyCastle.Asn1; using Org.BouncyCastle.Asn1.X509; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Asn1.Ocsp { @@ -31,7 +31,7 @@ namespace Org.BouncyCastle.Asn1.Ocsp return new ServiceLocator((Asn1Sequence) obj); } - throw new ArgumentException("unknown object in factory: " + obj.GetType().Name, "obj"); + throw new ArgumentException("unknown object in factory: " + Platform.GetTypeName(obj), "obj"); } public ServiceLocator( diff --git a/crypto/src/asn1/ocsp/Signature.cs b/crypto/src/asn1/ocsp/Signature.cs index df6f43332..d6b4ccfbf 100644 --- a/crypto/src/asn1/ocsp/Signature.cs +++ b/crypto/src/asn1/ocsp/Signature.cs @@ -1,7 +1,7 @@ using System; -using Org.BouncyCastle.Asn1; using Org.BouncyCastle.Asn1.X509; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Asn1.Ocsp { @@ -32,7 +32,7 @@ namespace Org.BouncyCastle.Asn1.Ocsp return new Signature((Asn1Sequence)obj); } - throw new ArgumentException("unknown object in factory: " + obj.GetType().Name, "obj"); + throw new ArgumentException("unknown object in factory: " + Platform.GetTypeName(obj), "obj"); } public Signature( diff --git a/crypto/src/asn1/ocsp/SingleResponse.cs b/crypto/src/asn1/ocsp/SingleResponse.cs index 93d4c21d6..544232abe 100644 --- a/crypto/src/asn1/ocsp/SingleResponse.cs +++ b/crypto/src/asn1/ocsp/SingleResponse.cs @@ -1,8 +1,8 @@ -using Org.BouncyCastle.Asn1; -using Org.BouncyCastle.Asn1.X509; - using System; +using Org.BouncyCastle.Asn1.X509; +using Org.BouncyCastle.Utilities; + namespace Org.BouncyCastle.Asn1.Ocsp { public class SingleResponse @@ -77,7 +77,7 @@ namespace Org.BouncyCastle.Asn1.Ocsp return new SingleResponse((Asn1Sequence)obj); } - throw new ArgumentException("unknown object in factory: " + obj.GetType().Name, "obj"); + throw new ArgumentException("unknown object in factory: " + Platform.GetTypeName(obj), "obj"); } public CertID CertId diff --git a/crypto/src/asn1/ocsp/TBSRequest.cs b/crypto/src/asn1/ocsp/TBSRequest.cs index 6bf75eb96..1ad8649f8 100644 --- a/crypto/src/asn1/ocsp/TBSRequest.cs +++ b/crypto/src/asn1/ocsp/TBSRequest.cs @@ -1,8 +1,8 @@ -using Org.BouncyCastle.Asn1; -using Org.BouncyCastle.Asn1.X509; - using System; +using Org.BouncyCastle.Asn1.X509; +using Org.BouncyCastle.Utilities; + namespace Org.BouncyCastle.Asn1.Ocsp { public class TbsRequest @@ -37,7 +37,7 @@ namespace Org.BouncyCastle.Asn1.Ocsp return new TbsRequest((Asn1Sequence)obj); } - throw new ArgumentException("unknown object in factory: " + obj.GetType().Name, "obj"); + throw new ArgumentException("unknown object in factory: " + Platform.GetTypeName(obj), "obj"); } public TbsRequest( diff --git a/crypto/src/asn1/pkcs/Attribute.cs b/crypto/src/asn1/pkcs/Attribute.cs index ceec115bd..185828596 100644 --- a/crypto/src/asn1/pkcs/Attribute.cs +++ b/crypto/src/asn1/pkcs/Attribute.cs @@ -1,6 +1,6 @@ using System; -using Org.BouncyCastle.Asn1; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Asn1.Pkcs { @@ -31,7 +31,7 @@ namespace Org.BouncyCastle.Asn1.Pkcs return new AttributePkcs(seq); } - throw new ArgumentException("Unknown object in factory: " + obj.GetType().FullName, "obj"); + throw new ArgumentException("Unknown object in factory: " + Platform.GetTypeName(obj), "obj"); } private AttributePkcs( diff --git a/crypto/src/asn1/pkcs/CertificationRequestInfo.cs b/crypto/src/asn1/pkcs/CertificationRequestInfo.cs index 690d06878..d57753235 100644 --- a/crypto/src/asn1/pkcs/CertificationRequestInfo.cs +++ b/crypto/src/asn1/pkcs/CertificationRequestInfo.cs @@ -1,6 +1,7 @@ using System; using Org.BouncyCastle.Asn1.X509; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Asn1.Pkcs { @@ -43,7 +44,7 @@ namespace Org.BouncyCastle.Asn1.Pkcs return new CertificationRequestInfo((Asn1Sequence) obj); } - throw new ArgumentException("Unknown object in factory: " + obj.GetType().FullName, "obj"); + throw new ArgumentException("Unknown object in factory: " + Platform.GetTypeName(obj), "obj"); } public CertificationRequestInfo( diff --git a/crypto/src/asn1/pkcs/EncryptedData.cs b/crypto/src/asn1/pkcs/EncryptedData.cs index 912064ace..7e95eb586 100644 --- a/crypto/src/asn1/pkcs/EncryptedData.cs +++ b/crypto/src/asn1/pkcs/EncryptedData.cs @@ -1,6 +1,7 @@ using System; using Org.BouncyCastle.Asn1.X509; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Asn1.Pkcs { @@ -42,7 +43,7 @@ namespace Org.BouncyCastle.Asn1.Pkcs return new EncryptedData((Asn1Sequence) obj); } - throw new ArgumentException("Unknown object in factory: " + obj.GetType().FullName, "obj"); + throw new ArgumentException("Unknown object in factory: " + Platform.GetTypeName(obj), "obj"); } private EncryptedData( diff --git a/crypto/src/asn1/pkcs/EncryptedPrivateKeyInfo.cs b/crypto/src/asn1/pkcs/EncryptedPrivateKeyInfo.cs index b97b8f5ea..987027009 100644 --- a/crypto/src/asn1/pkcs/EncryptedPrivateKeyInfo.cs +++ b/crypto/src/asn1/pkcs/EncryptedPrivateKeyInfo.cs @@ -2,6 +2,7 @@ using System; using System.Collections; using Org.BouncyCastle.Asn1.X509; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Asn1.Pkcs { @@ -42,7 +43,7 @@ namespace Org.BouncyCastle.Asn1.Pkcs return new EncryptedPrivateKeyInfo((Asn1Sequence) obj); } - throw new ArgumentException("Unknown object in factory: " + obj.GetType().FullName, "obj"); + throw new ArgumentException("Unknown object in factory: " + Platform.GetTypeName(obj), "obj"); } public AlgorithmIdentifier EncryptionAlgorithm diff --git a/crypto/src/asn1/pkcs/EncryptionScheme.cs b/crypto/src/asn1/pkcs/EncryptionScheme.cs index ff9103d12..7b90ece53 100644 --- a/crypto/src/asn1/pkcs/EncryptionScheme.cs +++ b/crypto/src/asn1/pkcs/EncryptionScheme.cs @@ -1,7 +1,7 @@ using System; -using Org.BouncyCastle.Asn1; using Org.BouncyCastle.Asn1.X509; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Asn1.Pkcs { @@ -33,7 +33,7 @@ namespace Org.BouncyCastle.Asn1.Pkcs return new EncryptionScheme((Asn1Sequence)obj); } - throw new ArgumentException("Unknown object in factory: " + obj.GetType().FullName, "obj"); + throw new ArgumentException("Unknown object in factory: " + Platform.GetTypeName(obj), "obj"); } public Asn1Object Asn1Object diff --git a/crypto/src/asn1/pkcs/IssuerAndSerialNumber.cs b/crypto/src/asn1/pkcs/IssuerAndSerialNumber.cs index ff608f15b..da863cb62 100644 --- a/crypto/src/asn1/pkcs/IssuerAndSerialNumber.cs +++ b/crypto/src/asn1/pkcs/IssuerAndSerialNumber.cs @@ -2,6 +2,7 @@ using System; using Org.BouncyCastle.Asn1.X509; using Org.BouncyCastle.Math; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Asn1.Pkcs { @@ -24,7 +25,7 @@ namespace Org.BouncyCastle.Asn1.Pkcs return new IssuerAndSerialNumber((Asn1Sequence) obj); } - throw new ArgumentException("Unknown object in factory: " + obj.GetType().FullName, "obj"); + throw new ArgumentException("Unknown object in factory: " + Platform.GetTypeName(obj), "obj"); } private IssuerAndSerialNumber( diff --git a/crypto/src/asn1/pkcs/MacData.cs b/crypto/src/asn1/pkcs/MacData.cs index 780b24153..c4b7df176 100644 --- a/crypto/src/asn1/pkcs/MacData.cs +++ b/crypto/src/asn1/pkcs/MacData.cs @@ -1,8 +1,8 @@ using System; -using Org.BouncyCastle.Asn1; using Org.BouncyCastle.Asn1.X509; using Org.BouncyCastle.Math; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Asn1.Pkcs { @@ -26,7 +26,7 @@ namespace Org.BouncyCastle.Asn1.Pkcs return new MacData((Asn1Sequence) obj); } - throw new ArgumentException("Unknown object in factory: " + obj.GetType().FullName, "obj"); + throw new ArgumentException("Unknown object in factory: " + Platform.GetTypeName(obj), "obj"); } private MacData( diff --git a/crypto/src/asn1/pkcs/PBEParameter.cs b/crypto/src/asn1/pkcs/PBEParameter.cs index 80d5ec3e1..56cea5fb7 100644 --- a/crypto/src/asn1/pkcs/PBEParameter.cs +++ b/crypto/src/asn1/pkcs/PBEParameter.cs @@ -1,8 +1,8 @@ using System; using System.Collections; -using Org.BouncyCastle.Asn1; using Org.BouncyCastle.Math; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Asn1.Pkcs { @@ -24,7 +24,7 @@ namespace Org.BouncyCastle.Asn1.Pkcs return new PbeParameter((Asn1Sequence) obj); } - throw new ArgumentException("Unknown object in factory: " + obj.GetType().FullName, "obj"); + throw new ArgumentException("Unknown object in factory: " + Platform.GetTypeName(obj), "obj"); } private PbeParameter(Asn1Sequence seq) diff --git a/crypto/src/asn1/pkcs/PBKDF2Params.cs b/crypto/src/asn1/pkcs/PBKDF2Params.cs index 5d1e9854f..279f30de8 100644 --- a/crypto/src/asn1/pkcs/PBKDF2Params.cs +++ b/crypto/src/asn1/pkcs/PBKDF2Params.cs @@ -1,6 +1,8 @@ using System; + using Org.BouncyCastle.Asn1.X509; using Org.BouncyCastle.Math; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Asn1.Pkcs { @@ -22,7 +24,7 @@ namespace Org.BouncyCastle.Asn1.Pkcs if (obj is Asn1Sequence) return new Pbkdf2Params((Asn1Sequence)obj); - throw new ArgumentException("Unknown object in factory: " + obj.GetType().FullName, "obj"); + throw new ArgumentException("Unknown object in factory: " + Platform.GetTypeName(obj), "obj"); } public Pbkdf2Params( diff --git a/crypto/src/asn1/pkcs/PKCS12PBEParams.cs b/crypto/src/asn1/pkcs/PKCS12PBEParams.cs index 7521f93ea..b41c289d8 100644 --- a/crypto/src/asn1/pkcs/PKCS12PBEParams.cs +++ b/crypto/src/asn1/pkcs/PKCS12PBEParams.cs @@ -1,7 +1,7 @@ using System; -using Org.BouncyCastle.Asn1; using Org.BouncyCastle.Math; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Asn1.Pkcs { @@ -42,7 +42,7 @@ namespace Org.BouncyCastle.Asn1.Pkcs return new Pkcs12PbeParams((Asn1Sequence) obj); } - throw new ArgumentException("Unknown object in factory: " + obj.GetType().FullName, "obj"); + throw new ArgumentException("Unknown object in factory: " + Platform.GetTypeName(obj), "obj"); } public BigInteger Iterations diff --git a/crypto/src/asn1/pkcs/RC2CBCParameter.cs b/crypto/src/asn1/pkcs/RC2CBCParameter.cs index f5355d012..880ca7443 100644 --- a/crypto/src/asn1/pkcs/RC2CBCParameter.cs +++ b/crypto/src/asn1/pkcs/RC2CBCParameter.cs @@ -1,6 +1,5 @@ using System; -using Org.BouncyCastle.Asn1; using Org.BouncyCastle.Math; using Org.BouncyCastle.Utilities; @@ -20,7 +19,7 @@ namespace Org.BouncyCastle.Asn1.Pkcs return new RC2CbcParameter((Asn1Sequence) obj); } - throw new ArgumentException("Unknown object in factory: " + obj.GetType().FullName, "obj"); + throw new ArgumentException("Unknown object in factory: " + Platform.GetTypeName(obj), "obj"); } public RC2CbcParameter( diff --git a/crypto/src/asn1/pkcs/RSAESOAEPparams.cs b/crypto/src/asn1/pkcs/RSAESOAEPparams.cs index 5ecb394fd..0cf22f860 100644 --- a/crypto/src/asn1/pkcs/RSAESOAEPparams.cs +++ b/crypto/src/asn1/pkcs/RSAESOAEPparams.cs @@ -2,6 +2,7 @@ using System; using Org.BouncyCastle.Asn1.Oiw; using Org.BouncyCastle.Asn1.X509; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Asn1.Pkcs { @@ -28,7 +29,7 @@ namespace Org.BouncyCastle.Asn1.Pkcs return new RsaesOaepParameters((Asn1Sequence)obj); } - throw new ArgumentException("Unknown object in factory: " + obj.GetType().FullName, "obj"); + throw new ArgumentException("Unknown object in factory: " + Platform.GetTypeName(obj), "obj"); } /** diff --git a/crypto/src/asn1/pkcs/RSASSAPSSparams.cs b/crypto/src/asn1/pkcs/RSASSAPSSparams.cs index 941620761..85849c362 100644 --- a/crypto/src/asn1/pkcs/RSASSAPSSparams.cs +++ b/crypto/src/asn1/pkcs/RSASSAPSSparams.cs @@ -2,6 +2,7 @@ using System; using Org.BouncyCastle.Asn1.Oiw; using Org.BouncyCastle.Asn1.X509; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Asn1.Pkcs { @@ -31,7 +32,7 @@ namespace Org.BouncyCastle.Asn1.Pkcs return new RsassaPssParameters((Asn1Sequence)obj); } - throw new ArgumentException("Unknown object in factory: " + obj.GetType().FullName, "obj"); + throw new ArgumentException("Unknown object in factory: " + Platform.GetTypeName(obj), "obj"); } /** diff --git a/crypto/src/asn1/pkcs/SignerInfo.cs b/crypto/src/asn1/pkcs/SignerInfo.cs index 1e4694547..a3dc48b5b 100644 --- a/crypto/src/asn1/pkcs/SignerInfo.cs +++ b/crypto/src/asn1/pkcs/SignerInfo.cs @@ -1,8 +1,8 @@ using System; using System.Collections; -using Org.BouncyCastle.Asn1; using Org.BouncyCastle.Asn1.X509; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Asn1.Pkcs { @@ -33,7 +33,7 @@ namespace Org.BouncyCastle.Asn1.Pkcs return new SignerInfo((Asn1Sequence) obj); } - throw new ArgumentException("Unknown object in factory: " + obj.GetType().FullName, "obj"); + throw new ArgumentException("Unknown object in factory: " + Platform.GetTypeName(obj), "obj"); } public SignerInfo( diff --git a/crypto/src/asn1/smime/SMIMECapabilities.cs b/crypto/src/asn1/smime/SMIMECapabilities.cs index 6435caf68..5bf48f321 100644 --- a/crypto/src/asn1/smime/SMIMECapabilities.cs +++ b/crypto/src/asn1/smime/SMIMECapabilities.cs @@ -62,7 +62,7 @@ namespace Org.BouncyCastle.Asn1.Smime (Asn1Sequence)(((AttributeX509) obj).AttrValues[0])); } - throw new ArgumentException("unknown object in factory: " + obj.GetType().Name, "obj"); + throw new ArgumentException("unknown object in factory: " + Platform.GetTypeName(obj), "obj"); } public SmimeCapabilities( diff --git a/crypto/src/asn1/tsp/Accuracy.cs b/crypto/src/asn1/tsp/Accuracy.cs index a193f52ff..9f2c7e8cc 100644 --- a/crypto/src/asn1/tsp/Accuracy.cs +++ b/crypto/src/asn1/tsp/Accuracy.cs @@ -1,5 +1,7 @@ using System; +using Org.BouncyCastle.Utilities; + namespace Org.BouncyCastle.Asn1.Tsp { public class Accuracy @@ -97,7 +99,7 @@ namespace Org.BouncyCastle.Asn1.Tsp } throw new ArgumentException( - "Unknown object in 'Accuracy' factory: " + o.GetType().FullName); + "Unknown object in 'Accuracy' factory: " + Platform.GetTypeName(o)); } public DerInteger Seconds diff --git a/crypto/src/asn1/tsp/MessageImprint.cs b/crypto/src/asn1/tsp/MessageImprint.cs index 0933bae21..44ef7d177 100644 --- a/crypto/src/asn1/tsp/MessageImprint.cs +++ b/crypto/src/asn1/tsp/MessageImprint.cs @@ -1,6 +1,7 @@ using System; using Org.BouncyCastle.Asn1.X509; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Asn1.Tsp { @@ -28,7 +29,7 @@ namespace Org.BouncyCastle.Asn1.Tsp } throw new ArgumentException( - "Unknown object in 'MessageImprint' factory: " + o.GetType().FullName); + "Unknown object in 'MessageImprint' factory: " + Platform.GetTypeName(o)); } private MessageImprint( diff --git a/crypto/src/asn1/tsp/TSTInfo.cs b/crypto/src/asn1/tsp/TSTInfo.cs index 61d5399c7..89f3e8b38 100644 --- a/crypto/src/asn1/tsp/TSTInfo.cs +++ b/crypto/src/asn1/tsp/TSTInfo.cs @@ -3,6 +3,7 @@ using System.Collections; using System.IO; using Org.BouncyCastle.Asn1.X509; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Asn1.Tsp { @@ -48,7 +49,7 @@ namespace Org.BouncyCastle.Asn1.Tsp } throw new ArgumentException( - "Unknown object in 'TstInfo' factory: " + o.GetType().FullName); + "Unknown object in 'TstInfo' factory: " + Platform.GetTypeName(o)); } private TstInfo( diff --git a/crypto/src/asn1/tsp/TimeStampReq.cs b/crypto/src/asn1/tsp/TimeStampReq.cs index 55e973e76..5b05f3369 100644 --- a/crypto/src/asn1/tsp/TimeStampReq.cs +++ b/crypto/src/asn1/tsp/TimeStampReq.cs @@ -1,6 +1,7 @@ using System; using Org.BouncyCastle.Asn1.X509; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Asn1.Tsp { @@ -28,7 +29,7 @@ namespace Org.BouncyCastle.Asn1.Tsp } throw new ArgumentException( - "Unknown object in 'TimeStampReq' factory: " + o.GetType().FullName); + "Unknown object in 'TimeStampReq' factory: " + Platform.GetTypeName(o)); } private TimeStampReq( diff --git a/crypto/src/asn1/tsp/TimeStampResp.cs b/crypto/src/asn1/tsp/TimeStampResp.cs index f26fb30bd..b91026064 100644 --- a/crypto/src/asn1/tsp/TimeStampResp.cs +++ b/crypto/src/asn1/tsp/TimeStampResp.cs @@ -1,8 +1,8 @@ using System; -using System.Collections; using Org.BouncyCastle.Asn1.Cmp; using Org.BouncyCastle.Asn1.Cms; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Asn1.Tsp { @@ -26,7 +26,7 @@ namespace Org.BouncyCastle.Asn1.Tsp } throw new ArgumentException( - "Unknown object in 'TimeStampResp' factory: " + o.GetType().FullName); + "Unknown object in 'TimeStampResp' factory: " + Platform.GetTypeName(o)); } private TimeStampResp( diff --git a/crypto/src/asn1/x500/DirectoryString.cs b/crypto/src/asn1/x500/DirectoryString.cs index 78ecc2663..d907c6456 100644 --- a/crypto/src/asn1/x500/DirectoryString.cs +++ b/crypto/src/asn1/x500/DirectoryString.cs @@ -1,5 +1,7 @@ using System; +using Org.BouncyCastle.Utilities; + namespace Org.BouncyCastle.Asn1.X500 { public class DirectoryString @@ -27,7 +29,7 @@ namespace Org.BouncyCastle.Asn1.X500 } } - throw new ArgumentException("unknown object in factory: " + obj.GetType().Name, "obj"); + throw new ArgumentException("unknown object in factory: " + Platform.GetTypeName(obj), "obj"); } public static DirectoryString GetInstance( diff --git a/crypto/src/asn1/x509/AccessDescription.cs b/crypto/src/asn1/x509/AccessDescription.cs index 09b5b5920..47374be8f 100644 --- a/crypto/src/asn1/x509/AccessDescription.cs +++ b/crypto/src/asn1/x509/AccessDescription.cs @@ -1,5 +1,7 @@ using System; +using Org.BouncyCastle.Utilities; + namespace Org.BouncyCastle.Asn1.X509 { /** @@ -28,7 +30,7 @@ namespace Org.BouncyCastle.Asn1.X509 if (obj is Asn1Sequence) return new AccessDescription((Asn1Sequence) obj); - throw new ArgumentException("unknown object in factory: " + obj.GetType().Name, "obj"); + throw new ArgumentException("unknown object in factory: " + Platform.GetTypeName(obj), "obj"); } private AccessDescription( diff --git a/crypto/src/asn1/x509/AttCertIssuer.cs b/crypto/src/asn1/x509/AttCertIssuer.cs index e9314fa92..407c4ae7a 100644 --- a/crypto/src/asn1/x509/AttCertIssuer.cs +++ b/crypto/src/asn1/x509/AttCertIssuer.cs @@ -1,6 +1,6 @@ using System; -using Org.BouncyCastle.Asn1; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Asn1.X509 { @@ -34,7 +34,7 @@ namespace Org.BouncyCastle.Asn1.X509 return new AttCertIssuer(GeneralNames.GetInstance(obj)); } - throw new ArgumentException("unknown object in factory: " + obj.GetType().Name, "obj"); + throw new ArgumentException("unknown object in factory: " + Platform.GetTypeName(obj), "obj"); } public static AttCertIssuer GetInstance( diff --git a/crypto/src/asn1/x509/AttCertValidityPeriod.cs b/crypto/src/asn1/x509/AttCertValidityPeriod.cs index 7f86cd0b8..d31e07402 100644 --- a/crypto/src/asn1/x509/AttCertValidityPeriod.cs +++ b/crypto/src/asn1/x509/AttCertValidityPeriod.cs @@ -1,6 +1,6 @@ using System; -using Org.BouncyCastle.Asn1; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Asn1.X509 { @@ -23,7 +23,7 @@ namespace Org.BouncyCastle.Asn1.X509 return new AttCertValidityPeriod((Asn1Sequence) obj); } - throw new ArgumentException("unknown object in factory: " + obj.GetType().Name, "obj"); + throw new ArgumentException("unknown object in factory: " + Platform.GetTypeName(obj), "obj"); } public static AttCertValidityPeriod GetInstance( diff --git a/crypto/src/asn1/x509/Attribute.cs b/crypto/src/asn1/x509/Attribute.cs index d26db93e9..da59b4285 100644 --- a/crypto/src/asn1/x509/Attribute.cs +++ b/crypto/src/asn1/x509/Attribute.cs @@ -1,6 +1,6 @@ using System; -using Org.BouncyCastle.Asn1; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Asn1.X509 { @@ -29,7 +29,7 @@ namespace Org.BouncyCastle.Asn1.X509 return new AttributeX509((Asn1Sequence) obj); } - throw new ArgumentException("unknown object in factory: " + obj.GetType().Name, "obj"); + throw new ArgumentException("unknown object in factory: " + Platform.GetTypeName(obj), "obj"); } private AttributeX509( diff --git a/crypto/src/asn1/x509/AttributeCertificateInfo.cs b/crypto/src/asn1/x509/AttributeCertificateInfo.cs index dcef3d472..526f8e69b 100644 --- a/crypto/src/asn1/x509/AttributeCertificateInfo.cs +++ b/crypto/src/asn1/x509/AttributeCertificateInfo.cs @@ -1,6 +1,6 @@ using System; -using Org.BouncyCastle.Asn1; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Asn1.X509 { @@ -37,7 +37,7 @@ namespace Org.BouncyCastle.Asn1.X509 return new AttributeCertificateInfo((Asn1Sequence) obj); } - throw new ArgumentException("unknown object in factory: " + obj.GetType().Name, "obj"); + throw new ArgumentException("unknown object in factory: " + Platform.GetTypeName(obj), "obj"); } private AttributeCertificateInfo( diff --git a/crypto/src/asn1/x509/AuthorityKeyIdentifier.cs b/crypto/src/asn1/x509/AuthorityKeyIdentifier.cs index 12ccacfc7..d5a9048cc 100644 --- a/crypto/src/asn1/x509/AuthorityKeyIdentifier.cs +++ b/crypto/src/asn1/x509/AuthorityKeyIdentifier.cs @@ -1,10 +1,10 @@ using System; using System.Collections; -using Org.BouncyCastle.Asn1; using Org.BouncyCastle.Crypto; using Org.BouncyCastle.Crypto.Digests; using Org.BouncyCastle.Math; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Asn1.X509 { @@ -54,7 +54,7 @@ namespace Org.BouncyCastle.Asn1.X509 return GetInstance(X509Extension.ConvertValueToObject((X509Extension) obj)); } - throw new ArgumentException("unknown object in factory: " + obj.GetType().Name, "obj"); + throw new ArgumentException("unknown object in factory: " + Platform.GetTypeName(obj), "obj"); } protected internal AuthorityKeyIdentifier( diff --git a/crypto/src/asn1/x509/BasicConstraints.cs b/crypto/src/asn1/x509/BasicConstraints.cs index 522cb61cc..098801f22 100644 --- a/crypto/src/asn1/x509/BasicConstraints.cs +++ b/crypto/src/asn1/x509/BasicConstraints.cs @@ -1,7 +1,7 @@ using System; -using Org.BouncyCastle.Asn1; using Org.BouncyCastle.Math; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Asn1.X509 { @@ -36,7 +36,7 @@ namespace Org.BouncyCastle.Asn1.X509 return GetInstance(X509Extension.ConvertValueToObject((X509Extension) obj)); } - throw new ArgumentException("unknown object in factory: " + obj.GetType().Name, "obj"); + throw new ArgumentException("unknown object in factory: " + Platform.GetTypeName(obj), "obj"); } private BasicConstraints( diff --git a/crypto/src/asn1/x509/CRLDistPoint.cs b/crypto/src/asn1/x509/CRLDistPoint.cs index 2b5c19798..56ba79ca5 100644 --- a/crypto/src/asn1/x509/CRLDistPoint.cs +++ b/crypto/src/asn1/x509/CRLDistPoint.cs @@ -30,7 +30,7 @@ namespace Org.BouncyCastle.Asn1.X509 return new CrlDistPoint((Asn1Sequence) obj); } - throw new ArgumentException("unknown object in factory: " + obj.GetType().Name, "obj"); + throw new ArgumentException("unknown object in factory: " + Platform.GetTypeName(obj), "obj"); } private CrlDistPoint( diff --git a/crypto/src/asn1/x509/CertificatePair.cs b/crypto/src/asn1/x509/CertificatePair.cs index 8baa64719..da9236010 100644 --- a/crypto/src/asn1/x509/CertificatePair.cs +++ b/crypto/src/asn1/x509/CertificatePair.cs @@ -1,5 +1,7 @@ using System; +using Org.BouncyCastle.Utilities; + namespace Org.BouncyCastle.Asn1.X509 { /** @@ -53,7 +55,7 @@ namespace Org.BouncyCastle.Asn1.X509 return new CertificatePair((Asn1Sequence) obj); } - throw new ArgumentException("unknown object in factory: " + obj.GetType().Name, "obj"); + throw new ArgumentException("unknown object in factory: " + Platform.GetTypeName(obj), "obj"); } /** diff --git a/crypto/src/asn1/x509/DSAParameter.cs b/crypto/src/asn1/x509/DSAParameter.cs index b2b325f4d..2eb65024b 100644 --- a/crypto/src/asn1/x509/DSAParameter.cs +++ b/crypto/src/asn1/x509/DSAParameter.cs @@ -2,6 +2,7 @@ using System; using System.Collections; using Org.BouncyCastle.Math; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Asn1.X509 { @@ -30,7 +31,7 @@ namespace Org.BouncyCastle.Asn1.X509 return new DsaParameter((Asn1Sequence) obj); } - throw new ArgumentException("Invalid DsaParameter: " + obj.GetType().Name); + throw new ArgumentException("Invalid DsaParameter: " + Platform.GetTypeName(obj)); } public DsaParameter( diff --git a/crypto/src/asn1/x509/DigestInfo.cs b/crypto/src/asn1/x509/DigestInfo.cs index 1dec227fa..3ac535e2e 100644 --- a/crypto/src/asn1/x509/DigestInfo.cs +++ b/crypto/src/asn1/x509/DigestInfo.cs @@ -1,6 +1,8 @@ using System; using System.Collections; +using Org.BouncyCastle.Utilities; + namespace Org.BouncyCastle.Asn1.X509 { /** @@ -37,7 +39,7 @@ namespace Org.BouncyCastle.Asn1.X509 return new DigestInfo((Asn1Sequence) obj); } - throw new ArgumentException("unknown object in factory: " + obj.GetType().Name, "obj"); + throw new ArgumentException("unknown object in factory: " + Platform.GetTypeName(obj), "obj"); } public DigestInfo( diff --git a/crypto/src/asn1/x509/DisplayText.cs b/crypto/src/asn1/x509/DisplayText.cs index 699f39031..39b3c98d7 100644 --- a/crypto/src/asn1/x509/DisplayText.cs +++ b/crypto/src/asn1/x509/DisplayText.cs @@ -1,5 +1,7 @@ using System; +using Org.BouncyCastle.Utilities; + namespace Org.BouncyCastle.Asn1.X509 { /** @@ -151,7 +153,7 @@ namespace Org.BouncyCastle.Asn1.X509 return (DisplayText) obj; } - throw new ArgumentException("unknown object in factory: " + obj.GetType().Name, "obj"); + throw new ArgumentException("unknown object in factory: " + Platform.GetTypeName(obj), "obj"); } public override Asn1Object ToAsn1Object() diff --git a/crypto/src/asn1/x509/DistributionPoint.cs b/crypto/src/asn1/x509/DistributionPoint.cs index ad1d3989e..40814c7a8 100644 --- a/crypto/src/asn1/x509/DistributionPoint.cs +++ b/crypto/src/asn1/x509/DistributionPoint.cs @@ -42,7 +42,7 @@ namespace Org.BouncyCastle.Asn1.X509 return new DistributionPoint((Asn1Sequence) obj); } - throw new ArgumentException("Invalid DistributionPoint: " + obj.GetType().Name); + throw new ArgumentException("Invalid DistributionPoint: " + Platform.GetTypeName(obj)); } private DistributionPoint( diff --git a/crypto/src/asn1/x509/DistributionPointName.cs b/crypto/src/asn1/x509/DistributionPointName.cs index 1a9d24241..43fdaf533 100644 --- a/crypto/src/asn1/x509/DistributionPointName.cs +++ b/crypto/src/asn1/x509/DistributionPointName.cs @@ -43,7 +43,7 @@ namespace Org.BouncyCastle.Asn1.X509 return new DistributionPointName((Asn1TaggedObject) obj); } - throw new ArgumentException("unknown object in factory: " + obj.GetType().Name, "obj"); + throw new ArgumentException("unknown object in factory: " + Platform.GetTypeName(obj), "obj"); } public DistributionPointName( diff --git a/crypto/src/asn1/x509/ExtendedKeyUsage.cs b/crypto/src/asn1/x509/ExtendedKeyUsage.cs index 9b1400db9..8f7e6a353 100644 --- a/crypto/src/asn1/x509/ExtendedKeyUsage.cs +++ b/crypto/src/asn1/x509/ExtendedKeyUsage.cs @@ -42,7 +42,7 @@ namespace Org.BouncyCastle.Asn1.X509 return GetInstance(X509Extension.ConvertValueToObject((X509Extension) obj)); } - throw new ArgumentException("Invalid ExtendedKeyUsage: " + obj.GetType().Name); + throw new ArgumentException("Invalid ExtendedKeyUsage: " + Platform.GetTypeName(obj)); } private ExtendedKeyUsage( diff --git a/crypto/src/asn1/x509/GeneralName.cs b/crypto/src/asn1/x509/GeneralName.cs index 16096623c..b8794ea8f 100644 --- a/crypto/src/asn1/x509/GeneralName.cs +++ b/crypto/src/asn1/x509/GeneralName.cs @@ -203,7 +203,7 @@ namespace Org.BouncyCastle.Asn1.X509 } } - throw new ArgumentException("unknown object in GetInstance: " + obj.GetType().FullName, "obj"); + throw new ArgumentException("unknown object in GetInstance: " + Platform.GetTypeName(obj), "obj"); } public static GeneralName GetInstance( diff --git a/crypto/src/asn1/x509/GeneralNames.cs b/crypto/src/asn1/x509/GeneralNames.cs index 6c5c8e690..fcd2ecb24 100644 --- a/crypto/src/asn1/x509/GeneralNames.cs +++ b/crypto/src/asn1/x509/GeneralNames.cs @@ -23,7 +23,7 @@ namespace Org.BouncyCastle.Asn1.X509 return new GeneralNames((Asn1Sequence) obj); } - throw new ArgumentException("unknown object in factory: " + obj.GetType().Name, "obj"); + throw new ArgumentException("unknown object in factory: " + Platform.GetTypeName(obj), "obj"); } public static GeneralNames GetInstance( diff --git a/crypto/src/asn1/x509/Holder.cs b/crypto/src/asn1/x509/Holder.cs index d04f1cb60..6e5315b80 100644 --- a/crypto/src/asn1/x509/Holder.cs +++ b/crypto/src/asn1/x509/Holder.cs @@ -1,5 +1,7 @@ using System; +using Org.BouncyCastle.Utilities; + namespace Org.BouncyCastle.Asn1.X509 { /** @@ -58,7 +60,7 @@ namespace Org.BouncyCastle.Asn1.X509 return new Holder((Asn1TaggedObject) obj); } - throw new ArgumentException("unknown object in factory: " + obj.GetType().Name, "obj"); + throw new ArgumentException("unknown object in factory: " + Platform.GetTypeName(obj), "obj"); } /** diff --git a/crypto/src/asn1/x509/IssuerSerial.cs b/crypto/src/asn1/x509/IssuerSerial.cs index 6a24e7333..1e47e022b 100644 --- a/crypto/src/asn1/x509/IssuerSerial.cs +++ b/crypto/src/asn1/x509/IssuerSerial.cs @@ -1,5 +1,7 @@ using System; +using Org.BouncyCastle.Utilities; + namespace Org.BouncyCastle.Asn1.X509 { public class IssuerSerial @@ -22,7 +24,7 @@ namespace Org.BouncyCastle.Asn1.X509 return new IssuerSerial((Asn1Sequence) obj); } - throw new ArgumentException("unknown object in factory: " + obj.GetType().Name, "obj"); + throw new ArgumentException("unknown object in factory: " + Platform.GetTypeName(obj), "obj"); } public static IssuerSerial GetInstance( diff --git a/crypto/src/asn1/x509/IssuingDistributionPoint.cs b/crypto/src/asn1/x509/IssuingDistributionPoint.cs index 3af0d565f..8e9362b90 100644 --- a/crypto/src/asn1/x509/IssuingDistributionPoint.cs +++ b/crypto/src/asn1/x509/IssuingDistributionPoint.cs @@ -48,7 +48,7 @@ namespace Org.BouncyCastle.Asn1.X509 return new IssuingDistributionPoint((Asn1Sequence) obj); } - throw new ArgumentException("unknown object in factory: " + obj.GetType().Name, "obj"); + throw new ArgumentException("unknown object in factory: " + Platform.GetTypeName(obj), "obj"); } /** diff --git a/crypto/src/asn1/x509/NameConstraints.cs b/crypto/src/asn1/x509/NameConstraints.cs index c178f5b45..0c5fea8b3 100644 --- a/crypto/src/asn1/x509/NameConstraints.cs +++ b/crypto/src/asn1/x509/NameConstraints.cs @@ -1,6 +1,8 @@ using System; using System.Collections; +using Org.BouncyCastle.Utilities; + namespace Org.BouncyCastle.Asn1.X509 { public class NameConstraints @@ -21,7 +23,7 @@ namespace Org.BouncyCastle.Asn1.X509 return new NameConstraints((Asn1Sequence) obj); } - throw new ArgumentException("unknown object in factory: " + obj.GetType().Name, "obj"); + throw new ArgumentException("unknown object in factory: " + Platform.GetTypeName(obj), "obj"); } public NameConstraints( diff --git a/crypto/src/asn1/x509/ObjectDigestInfo.cs b/crypto/src/asn1/x509/ObjectDigestInfo.cs index 6d5b9c692..9cd9a5f4c 100644 --- a/crypto/src/asn1/x509/ObjectDigestInfo.cs +++ b/crypto/src/asn1/x509/ObjectDigestInfo.cs @@ -1,5 +1,7 @@ using System; +using Org.BouncyCastle.Utilities; + namespace Org.BouncyCastle.Asn1.X509 { /** @@ -58,7 +60,7 @@ namespace Org.BouncyCastle.Asn1.X509 return new ObjectDigestInfo((Asn1Sequence) obj); } - throw new ArgumentException("unknown object in factory: " + obj.GetType().Name, "obj"); + throw new ArgumentException("unknown object in factory: " + Platform.GetTypeName(obj), "obj"); } public static ObjectDigestInfo GetInstance( diff --git a/crypto/src/asn1/x509/PrivateKeyUsagePeriod.cs b/crypto/src/asn1/x509/PrivateKeyUsagePeriod.cs index ad2961eb0..a3d7a3608 100644 --- a/crypto/src/asn1/x509/PrivateKeyUsagePeriod.cs +++ b/crypto/src/asn1/x509/PrivateKeyUsagePeriod.cs @@ -1,5 +1,7 @@ using System; +using Org.BouncyCastle.Utilities; + namespace Org.BouncyCastle.Asn1.X509 { /// <remarks> @@ -31,7 +33,7 @@ namespace Org.BouncyCastle.Asn1.X509 return GetInstance(X509Extension.ConvertValueToObject((X509Extension) obj)); } - throw new ArgumentException("unknown object in GetInstance: " + obj.GetType().FullName, "obj"); + throw new ArgumentException("unknown object in GetInstance: " + Platform.GetTypeName(obj), "obj"); } private DerGeneralizedTime _notBefore, _notAfter; diff --git a/crypto/src/asn1/x509/RSAPublicKeyStructure.cs b/crypto/src/asn1/x509/RSAPublicKeyStructure.cs index bdcba783e..20fdd96ac 100644 --- a/crypto/src/asn1/x509/RSAPublicKeyStructure.cs +++ b/crypto/src/asn1/x509/RSAPublicKeyStructure.cs @@ -1,9 +1,10 @@ -using Org.BouncyCastle.Asn1; -using Org.BouncyCastle.Math; - using System; using System.Collections; +using Org.BouncyCastle.Asn1; +using Org.BouncyCastle.Math; +using Org.BouncyCastle.Utilities; + namespace Org.BouncyCastle.Asn1.X509 { public class RsaPublicKeyStructure @@ -32,7 +33,7 @@ namespace Org.BouncyCastle.Asn1.X509 return new RsaPublicKeyStructure((Asn1Sequence) obj); } - throw new ArgumentException("Invalid RsaPublicKeyStructure: " + obj.GetType().Name); + throw new ArgumentException("Invalid RsaPublicKeyStructure: " + Platform.GetTypeName(obj)); } public RsaPublicKeyStructure( diff --git a/crypto/src/asn1/x509/SubjectDirectoryAttributes.cs b/crypto/src/asn1/x509/SubjectDirectoryAttributes.cs index c76d94d78..77923e0d2 100644 --- a/crypto/src/asn1/x509/SubjectDirectoryAttributes.cs +++ b/crypto/src/asn1/x509/SubjectDirectoryAttributes.cs @@ -43,7 +43,7 @@ namespace Org.BouncyCastle.Asn1.X509 return new SubjectDirectoryAttributes((Asn1Sequence) obj); } - throw new ArgumentException("unknown object in factory: " + obj.GetType().Name, "obj"); + throw new ArgumentException("unknown object in factory: " + Platform.GetTypeName(obj), "obj"); } /** diff --git a/crypto/src/asn1/x509/SubjectKeyIdentifier.cs b/crypto/src/asn1/x509/SubjectKeyIdentifier.cs index e640760f3..f2e6cc006 100644 --- a/crypto/src/asn1/x509/SubjectKeyIdentifier.cs +++ b/crypto/src/asn1/x509/SubjectKeyIdentifier.cs @@ -2,6 +2,7 @@ using System; using Org.BouncyCastle.Crypto; using Org.BouncyCastle.Crypto.Digests; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Asn1.X509 { @@ -46,7 +47,7 @@ namespace Org.BouncyCastle.Asn1.X509 return GetInstance(X509Extension.ConvertValueToObject((X509Extension) obj)); } - throw new ArgumentException("Invalid SubjectKeyIdentifier: " + obj.GetType().Name); + throw new ArgumentException("Invalid SubjectKeyIdentifier: " + Platform.GetTypeName(obj)); } public SubjectKeyIdentifier( diff --git a/crypto/src/asn1/x509/TBSCertList.cs b/crypto/src/asn1/x509/TBSCertList.cs index b5934a230..5767a7f21 100644 --- a/crypto/src/asn1/x509/TBSCertList.cs +++ b/crypto/src/asn1/x509/TBSCertList.cs @@ -1,6 +1,7 @@ using System; using System.Collections; +using Org.BouncyCastle.Utilities; using Org.BouncyCastle.Utilities.Collections; namespace Org.BouncyCastle.Asn1.X509 @@ -155,7 +156,7 @@ namespace Org.BouncyCastle.Asn1.X509 return new TbsCertificateList((Asn1Sequence) obj); } - throw new ArgumentException("unknown object in factory: " + obj.GetType().Name, "obj"); + throw new ArgumentException("unknown object in factory: " + Platform.GetTypeName(obj), "obj"); } internal TbsCertificateList( diff --git a/crypto/src/asn1/x509/Target.cs b/crypto/src/asn1/x509/Target.cs index 309b28c95..7c4f9db7e 100644 --- a/crypto/src/asn1/x509/Target.cs +++ b/crypto/src/asn1/x509/Target.cs @@ -1,5 +1,7 @@ using System; +using Org.BouncyCastle.Utilities; + namespace Org.BouncyCastle.Asn1.X509 { /** @@ -53,7 +55,7 @@ namespace Org.BouncyCastle.Asn1.X509 return new Target((Asn1TaggedObject) obj); } - throw new ArgumentException("unknown object in factory: " + obj.GetType().Name, "obj"); + throw new ArgumentException("unknown object in factory: " + Platform.GetTypeName(obj), "obj"); } /** diff --git a/crypto/src/asn1/x509/TargetInformation.cs b/crypto/src/asn1/x509/TargetInformation.cs index 75b18c0c9..2bf218977 100644 --- a/crypto/src/asn1/x509/TargetInformation.cs +++ b/crypto/src/asn1/x509/TargetInformation.cs @@ -1,5 +1,7 @@ using System; +using Org.BouncyCastle.Utilities; + namespace Org.BouncyCastle.Asn1.X509 { /** @@ -38,7 +40,7 @@ namespace Org.BouncyCastle.Asn1.X509 return new TargetInformation((Asn1Sequence) obj); } - throw new ArgumentException("unknown object in factory: " + obj.GetType().Name, "obj"); + throw new ArgumentException("unknown object in factory: " + Platform.GetTypeName(obj), "obj"); } /** diff --git a/crypto/src/asn1/x509/Targets.cs b/crypto/src/asn1/x509/Targets.cs index 3e436d8d8..0387e1f6b 100644 --- a/crypto/src/asn1/x509/Targets.cs +++ b/crypto/src/asn1/x509/Targets.cs @@ -1,5 +1,7 @@ using System; +using Org.BouncyCastle.Utilities; + namespace Org.BouncyCastle.Asn1.X509 { /** @@ -52,7 +54,7 @@ namespace Org.BouncyCastle.Asn1.X509 return new Targets((Asn1Sequence) obj); } - throw new ArgumentException("unknown object in factory: " + obj.GetType().Name, "obj"); + throw new ArgumentException("unknown object in factory: " + Platform.GetTypeName(obj), "obj"); } /** diff --git a/crypto/src/asn1/x509/Time.cs b/crypto/src/asn1/x509/Time.cs index ffe293521..fa3936d63 100644 --- a/crypto/src/asn1/x509/Time.cs +++ b/crypto/src/asn1/x509/Time.cs @@ -1,6 +1,8 @@ using System; using System.Globalization; +using Org.BouncyCastle.Utilities; + namespace Org.BouncyCastle.Asn1.X509 { public class Time @@ -62,7 +64,7 @@ namespace Org.BouncyCastle.Asn1.X509 if (obj is DerGeneralizedTime) return new Time((DerGeneralizedTime)obj); - throw new ArgumentException("unknown object in factory: " + obj.GetType().Name, "obj"); + throw new ArgumentException("unknown object in factory: " + Platform.GetTypeName(obj), "obj"); } public string GetTime() diff --git a/crypto/src/asn1/x509/X509Extensions.cs b/crypto/src/asn1/x509/X509Extensions.cs index 1896450f5..2ef73f629 100644 --- a/crypto/src/asn1/x509/X509Extensions.cs +++ b/crypto/src/asn1/x509/X509Extensions.cs @@ -192,7 +192,7 @@ namespace Org.BouncyCastle.Asn1.X509 return GetInstance(((Asn1TaggedObject) obj).GetObject()); } - throw new ArgumentException("unknown object in factory: " + obj.GetType().Name, "obj"); + throw new ArgumentException("unknown object in factory: " + Platform.GetTypeName(obj), "obj"); } /** diff --git a/crypto/src/asn1/x509/qualified/BiometricData.cs b/crypto/src/asn1/x509/qualified/BiometricData.cs index 61d7c99cb..bb70c342c 100644 --- a/crypto/src/asn1/x509/qualified/BiometricData.cs +++ b/crypto/src/asn1/x509/qualified/BiometricData.cs @@ -1,8 +1,6 @@ using System; -using System.Collections; -using Org.BouncyCastle.Asn1; -using Org.BouncyCastle.Asn1.X509; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Asn1.X509.Qualified { @@ -37,7 +35,7 @@ namespace Org.BouncyCastle.Asn1.X509.Qualified return new BiometricData(Asn1Sequence.GetInstance(obj)); } - throw new ArgumentException("unknown object in GetInstance: " + obj.GetType().FullName, "obj"); + throw new ArgumentException("unknown object in GetInstance: " + Platform.GetTypeName(obj), "obj"); } private BiometricData( diff --git a/crypto/src/asn1/x509/qualified/Iso4217CurrencyCode.cs b/crypto/src/asn1/x509/qualified/Iso4217CurrencyCode.cs index 3300562c8..9ec88f5ed 100644 --- a/crypto/src/asn1/x509/qualified/Iso4217CurrencyCode.cs +++ b/crypto/src/asn1/x509/qualified/Iso4217CurrencyCode.cs @@ -1,6 +1,6 @@ using System; -using Org.BouncyCastle.Asn1; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Asn1.X509.Qualified { @@ -45,7 +45,7 @@ namespace Org.BouncyCastle.Asn1.X509.Qualified return new Iso4217CurrencyCode(alphabetic.GetString()); } - throw new ArgumentException("unknown object in GetInstance: " + obj.GetType().FullName, "obj"); + throw new ArgumentException("unknown object in GetInstance: " + Platform.GetTypeName(obj), "obj"); } public Iso4217CurrencyCode( @@ -53,7 +53,7 @@ namespace Org.BouncyCastle.Asn1.X509.Qualified { if (numeric > NumericMaxSize || numeric < NumericMinSize) { - throw new ArgumentException("wrong size in numeric code : not in (" +NumericMinSize +".."+ NumericMaxSize +")"); + throw new ArgumentException("wrong size in numeric code : not in (" + NumericMinSize + ".." + NumericMaxSize + ")"); } obj = new DerInteger(numeric); diff --git a/crypto/src/asn1/x509/qualified/MonetaryValue.cs b/crypto/src/asn1/x509/qualified/MonetaryValue.cs index 45e113671..d703de943 100644 --- a/crypto/src/asn1/x509/qualified/MonetaryValue.cs +++ b/crypto/src/asn1/x509/qualified/MonetaryValue.cs @@ -1,8 +1,8 @@ using System; using System.Collections; -using Org.BouncyCastle.Asn1; using Org.BouncyCastle.Math; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Asn1.X509.Qualified { @@ -36,7 +36,7 @@ namespace Org.BouncyCastle.Asn1.X509.Qualified return new MonetaryValue(Asn1Sequence.GetInstance(obj)); } - throw new ArgumentException("unknown object in GetInstance: " + obj.GetType().FullName, "obj"); + throw new ArgumentException("unknown object in GetInstance: " + Platform.GetTypeName(obj), "obj"); } private MonetaryValue( diff --git a/crypto/src/asn1/x509/qualified/QCStatement.cs b/crypto/src/asn1/x509/qualified/QCStatement.cs index 317f03447..a8e214cbf 100644 --- a/crypto/src/asn1/x509/qualified/QCStatement.cs +++ b/crypto/src/asn1/x509/qualified/QCStatement.cs @@ -1,7 +1,6 @@ using System; -using System.Collections; -using Org.BouncyCastle.Asn1; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Asn1.X509.Qualified { @@ -32,7 +31,7 @@ namespace Org.BouncyCastle.Asn1.X509.Qualified return new QCStatement(Asn1Sequence.GetInstance(obj)); } - throw new ArgumentException("unknown object in GetInstance: " + obj.GetType().FullName, "obj"); + throw new ArgumentException("unknown object in GetInstance: " + Platform.GetTypeName(obj), "obj"); } private QCStatement( diff --git a/crypto/src/asn1/x509/qualified/SemanticsInformation.cs b/crypto/src/asn1/x509/qualified/SemanticsInformation.cs index 72e7cd0e1..5fe5f936c 100644 --- a/crypto/src/asn1/x509/qualified/SemanticsInformation.cs +++ b/crypto/src/asn1/x509/qualified/SemanticsInformation.cs @@ -1,8 +1,8 @@ using System; using System.Collections; -using Org.BouncyCastle.Asn1; using Org.BouncyCastle.Asn1.X509; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Asn1.X509.Qualified { @@ -39,7 +39,7 @@ namespace Org.BouncyCastle.Asn1.X509.Qualified return new SemanticsInformation(Asn1Sequence.GetInstance(obj)); } - throw new ArgumentException("unknown object in GetInstance: " + obj.GetType().FullName, "obj"); + throw new ArgumentException("unknown object in GetInstance: " + Platform.GetTypeName(obj), "obj"); } public SemanticsInformation( diff --git a/crypto/src/asn1/x509/qualified/TypeOfBiometricData.cs b/crypto/src/asn1/x509/qualified/TypeOfBiometricData.cs index a77e54acb..17b7841c3 100644 --- a/crypto/src/asn1/x509/qualified/TypeOfBiometricData.cs +++ b/crypto/src/asn1/x509/qualified/TypeOfBiometricData.cs @@ -1,6 +1,6 @@ using System; -using Org.BouncyCastle.Asn1; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Asn1.X509.Qualified { @@ -46,7 +46,7 @@ namespace Org.BouncyCastle.Asn1.X509.Qualified return new TypeOfBiometricData(BiometricDataOid); } - throw new ArgumentException("unknown object in GetInstance: " + obj.GetType().FullName, "obj"); + throw new ArgumentException("unknown object in GetInstance: " + Platform.GetTypeName(obj), "obj"); } public TypeOfBiometricData( diff --git a/crypto/src/asn1/x509/sigi/NameOrPseudonym.cs b/crypto/src/asn1/x509/sigi/NameOrPseudonym.cs index 222895cf1..2402e3832 100644 --- a/crypto/src/asn1/x509/sigi/NameOrPseudonym.cs +++ b/crypto/src/asn1/x509/sigi/NameOrPseudonym.cs @@ -2,6 +2,7 @@ using System; using System.Collections; using Org.BouncyCastle.Asn1.X500; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Asn1.X509.SigI { @@ -46,7 +47,7 @@ namespace Org.BouncyCastle.Asn1.X509.SigI return new NameOrPseudonym((Asn1Sequence) obj); } - throw new ArgumentException("unknown object in factory: " + obj.GetType().Name, "obj"); + throw new ArgumentException("unknown object in factory: " + Platform.GetTypeName(obj), "obj"); } /** @@ -95,7 +96,7 @@ namespace Org.BouncyCastle.Asn1.X509.SigI throw new ArgumentException("Bad sequence size: " + seq.Count); if (!(seq[0] is IAsn1String)) - throw new ArgumentException("Bad object encountered: " + seq[0].GetType().Name); + throw new ArgumentException("Bad object encountered: " + Platform.GetTypeName(seq[0])); surname = DirectoryString.GetInstance(seq[0]); givenName = Asn1Sequence.GetInstance(seq[1]); diff --git a/crypto/src/asn1/x509/sigi/PersonalData.cs b/crypto/src/asn1/x509/sigi/PersonalData.cs index 6acdc7308..dba345c42 100644 --- a/crypto/src/asn1/x509/sigi/PersonalData.cs +++ b/crypto/src/asn1/x509/sigi/PersonalData.cs @@ -3,6 +3,7 @@ using System.Collections; using Org.BouncyCastle.Asn1.X500; using Org.BouncyCastle.Math; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Asn1.X509.SigI { @@ -47,7 +48,7 @@ namespace Org.BouncyCastle.Asn1.X509.SigI return new PersonalData((Asn1Sequence) obj); } - throw new ArgumentException("unknown object in factory: " + obj.GetType().Name, "obj"); + throw new ArgumentException("unknown object in factory: " + Platform.GetTypeName(obj), "obj"); } /** diff --git a/crypto/src/asn1/x9/DHDomainParameters.cs b/crypto/src/asn1/x9/DHDomainParameters.cs index 8de869694..b8c1ac030 100644 --- a/crypto/src/asn1/x9/DHDomainParameters.cs +++ b/crypto/src/asn1/x9/DHDomainParameters.cs @@ -1,6 +1,8 @@ using System; using System.Collections; +using Org.BouncyCastle.Utilities; + namespace Org.BouncyCastle.Asn1.X9 { public class DHDomainParameters @@ -22,7 +24,7 @@ namespace Org.BouncyCastle.Asn1.X9 if (obj is Asn1Sequence) return new DHDomainParameters((Asn1Sequence)obj); - throw new ArgumentException("Invalid DHDomainParameters: " + obj.GetType().FullName, "obj"); + throw new ArgumentException("Invalid DHDomainParameters: " + Platform.GetTypeName(obj), "obj"); } public DHDomainParameters(DerInteger p, DerInteger g, DerInteger q, DerInteger j, diff --git a/crypto/src/asn1/x9/DHPublicKey.cs b/crypto/src/asn1/x9/DHPublicKey.cs index 1a20a8a16..74a14a2ee 100644 --- a/crypto/src/asn1/x9/DHPublicKey.cs +++ b/crypto/src/asn1/x9/DHPublicKey.cs @@ -1,5 +1,7 @@ using System; +using Org.BouncyCastle.Utilities; + namespace Org.BouncyCastle.Asn1.X9 { public class DHPublicKey @@ -20,7 +22,7 @@ namespace Org.BouncyCastle.Asn1.X9 if (obj is DerInteger) return new DHPublicKey((DerInteger)obj); - throw new ArgumentException("Invalid DHPublicKey: " + obj.GetType().FullName, "obj"); + throw new ArgumentException("Invalid DHPublicKey: " + Platform.GetTypeName(obj), "obj"); } public DHPublicKey(DerInteger y) diff --git a/crypto/src/asn1/x9/DHValidationParms.cs b/crypto/src/asn1/x9/DHValidationParms.cs index a37964cfb..c63c50205 100644 --- a/crypto/src/asn1/x9/DHValidationParms.cs +++ b/crypto/src/asn1/x9/DHValidationParms.cs @@ -1,5 +1,7 @@ using System; +using Org.BouncyCastle.Utilities; + namespace Org.BouncyCastle.Asn1.X9 { public class DHValidationParms @@ -21,7 +23,7 @@ namespace Org.BouncyCastle.Asn1.X9 if (obj is Asn1Sequence) return new DHValidationParms((Asn1Sequence)obj); - throw new ArgumentException("Invalid DHValidationParms: " + obj.GetType().FullName, "obj"); + throw new ArgumentException("Invalid DHValidationParms: " + Platform.GetTypeName(obj), "obj"); } public DHValidationParms(DerBitString seed, DerInteger pgenCounter) diff --git a/crypto/src/crypto/engines/AesEngine.cs b/crypto/src/crypto/engines/AesEngine.cs index c84f4a964..ba62af4da 100644 --- a/crypto/src/crypto/engines/AesEngine.cs +++ b/crypto/src/crypto/engines/AesEngine.cs @@ -3,6 +3,7 @@ using System.Diagnostics; using Org.BouncyCastle.Crypto.Parameters; using Org.BouncyCastle.Crypto.Utilities; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Crypto.Engines { @@ -452,7 +453,8 @@ namespace Org.BouncyCastle.Crypto.Engines KeyParameter keyParameter = parameters as KeyParameter; if (keyParameter == null) - throw new ArgumentException("invalid parameter passed to AES init - " + parameters.GetType().Name); + throw new ArgumentException("invalid parameter passed to AES init - " + + Platform.GetTypeName(parameters)); WorkingKey = GenerateWorkingKey(keyParameter.GetKey(), forEncryption); diff --git a/crypto/src/crypto/engines/AesFastEngine.cs b/crypto/src/crypto/engines/AesFastEngine.cs index 18367a324..3a9c3a89e 100644 --- a/crypto/src/crypto/engines/AesFastEngine.cs +++ b/crypto/src/crypto/engines/AesFastEngine.cs @@ -3,6 +3,7 @@ using System.Diagnostics; using Org.BouncyCastle.Crypto.Parameters; using Org.BouncyCastle.Crypto.Utilities; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Crypto.Engines { @@ -788,7 +789,8 @@ namespace Org.BouncyCastle.Crypto.Engines KeyParameter keyParameter = parameters as KeyParameter; if (keyParameter == null) - throw new ArgumentException("invalid parameter passed to AES init - " + parameters.GetType().Name); + throw new ArgumentException("invalid parameter passed to AES init - " + + Platform.GetTypeName(parameters)); WorkingKey = GenerateWorkingKey(keyParameter.GetKey(), forEncryption); diff --git a/crypto/src/crypto/engines/AesLightEngine.cs b/crypto/src/crypto/engines/AesLightEngine.cs index a48fa5857..9cc9c34a0 100644 --- a/crypto/src/crypto/engines/AesLightEngine.cs +++ b/crypto/src/crypto/engines/AesLightEngine.cs @@ -3,6 +3,7 @@ using System.Diagnostics; using Org.BouncyCastle.Crypto.Parameters; using Org.BouncyCastle.Crypto.Utilities; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Crypto.Engines { @@ -349,7 +350,8 @@ namespace Org.BouncyCastle.Crypto.Engines KeyParameter keyParameter = parameters as KeyParameter; if (keyParameter == null) - throw new ArgumentException("invalid parameter passed to AES init - " + parameters.GetType().Name); + throw new ArgumentException("invalid parameter passed to AES init - " + + Platform.GetTypeName(parameters)); WorkingKey = GenerateWorkingKey(keyParameter.GetKey(), forEncryption); diff --git a/crypto/src/crypto/engines/BlowfishEngine.cs b/crypto/src/crypto/engines/BlowfishEngine.cs index 7b50e832f..e38f4e8f6 100644 --- a/crypto/src/crypto/engines/BlowfishEngine.cs +++ b/crypto/src/crypto/engines/BlowfishEngine.cs @@ -2,6 +2,7 @@ using System; using Org.BouncyCastle.Crypto.Parameters; using Org.BouncyCastle.Crypto.Utilities; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Crypto.Engines { @@ -329,7 +330,7 @@ namespace Org.BouncyCastle.Crypto.Engines ICipherParameters parameters) { if (!(parameters is KeyParameter)) - throw new ArgumentException("invalid parameter passed to Blowfish init - " + parameters.GetType().ToString()); + throw new ArgumentException("invalid parameter passed to Blowfish init - " + Platform.GetTypeName(parameters)); this.encrypting = forEncryption; this.workingKey = ((KeyParameter)parameters).GetKey(); diff --git a/crypto/src/crypto/engines/Cast5Engine.cs b/crypto/src/crypto/engines/Cast5Engine.cs index 1af30a335..53836db02 100644 --- a/crypto/src/crypto/engines/Cast5Engine.cs +++ b/crypto/src/crypto/engines/Cast5Engine.cs @@ -2,6 +2,7 @@ using System; using Org.BouncyCastle.Crypto.Parameters; using Org.BouncyCastle.Crypto.Utilities; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Crypto.Engines { @@ -334,7 +335,7 @@ namespace Org.BouncyCastle.Crypto.Engines ICipherParameters parameters) { if (!(parameters is KeyParameter)) - throw new ArgumentException("Invalid parameter passed to "+ AlgorithmName +" init - " + parameters.GetType().ToString()); + throw new ArgumentException("Invalid parameter passed to "+ AlgorithmName +" init - " + Platform.GetTypeName(parameters)); _encrypting = forEncryption; _workingKey = ((KeyParameter)parameters).GetKey(); diff --git a/crypto/src/crypto/engines/DesEdeEngine.cs b/crypto/src/crypto/engines/DesEdeEngine.cs index bc40b56a8..2fac24ac0 100644 --- a/crypto/src/crypto/engines/DesEdeEngine.cs +++ b/crypto/src/crypto/engines/DesEdeEngine.cs @@ -1,6 +1,7 @@ using System; using Org.BouncyCastle.Crypto.Parameters; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Crypto.Engines { @@ -24,7 +25,7 @@ namespace Org.BouncyCastle.Crypto.Engines ICipherParameters parameters) { if (!(parameters is KeyParameter)) - throw new ArgumentException("invalid parameter passed to DESede init - " + parameters.GetType().ToString()); + throw new ArgumentException("invalid parameter passed to DESede init - " + Platform.GetTypeName(parameters)); byte[] keyMaster = ((KeyParameter)parameters).GetKey(); if (keyMaster.Length != 24 && keyMaster.Length != 16) diff --git a/crypto/src/crypto/engines/DesEngine.cs b/crypto/src/crypto/engines/DesEngine.cs index a6d580bb6..cfd50681e 100644 --- a/crypto/src/crypto/engines/DesEngine.cs +++ b/crypto/src/crypto/engines/DesEngine.cs @@ -2,6 +2,7 @@ using System; using Org.BouncyCastle.Crypto.Parameters; using Org.BouncyCastle.Crypto.Utilities; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Crypto.Engines { @@ -31,7 +32,7 @@ namespace Org.BouncyCastle.Crypto.Engines ICipherParameters parameters) { if (!(parameters is KeyParameter)) - throw new ArgumentException("invalid parameter passed to DES init - " + parameters.GetType().ToString()); + throw new ArgumentException("invalid parameter passed to DES init - " + Platform.GetTypeName(parameters)); workingKey = GenerateWorkingKey(forEncryption, ((KeyParameter)parameters).GetKey()); } diff --git a/crypto/src/crypto/engines/GOST28147Engine.cs b/crypto/src/crypto/engines/GOST28147Engine.cs index e37ddaefd..71e6d9e44 100644 --- a/crypto/src/crypto/engines/GOST28147Engine.cs +++ b/crypto/src/crypto/engines/GOST28147Engine.cs @@ -183,7 +183,8 @@ namespace Org.BouncyCastle.Crypto.Engines } else if (parameters != null) { - throw new ArgumentException("invalid parameter passed to Gost28147 init - " + parameters.GetType().Name); + throw new ArgumentException("invalid parameter passed to Gost28147 init - " + + Platform.GetTypeName(parameters)); } } diff --git a/crypto/src/crypto/engines/HC128Engine.cs b/crypto/src/crypto/engines/HC128Engine.cs index 40c7a4e17..7bd1a48ed 100644 --- a/crypto/src/crypto/engines/HC128Engine.cs +++ b/crypto/src/crypto/engines/HC128Engine.cs @@ -2,6 +2,7 @@ using System; using Org.BouncyCastle.Crypto.Parameters; using Org.BouncyCastle.Crypto.Utilities; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Crypto.Engines { @@ -180,7 +181,7 @@ namespace Org.BouncyCastle.Crypto.Engines else { throw new ArgumentException( - "Invalid parameter passed to HC128 init - " + parameters.GetType().Name, + "Invalid parameter passed to HC128 init - " + Platform.GetTypeName(parameters), "parameters"); } diff --git a/crypto/src/crypto/engines/HC256Engine.cs b/crypto/src/crypto/engines/HC256Engine.cs index 6eb360711..b72258a19 100644 --- a/crypto/src/crypto/engines/HC256Engine.cs +++ b/crypto/src/crypto/engines/HC256Engine.cs @@ -2,6 +2,7 @@ using System; using Org.BouncyCastle.Crypto.Parameters; using Org.BouncyCastle.Crypto.Utilities; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Crypto.Engines { @@ -164,7 +165,7 @@ namespace Org.BouncyCastle.Crypto.Engines else { throw new ArgumentException( - "Invalid parameter passed to HC256 init - " + parameters.GetType().Name, + "Invalid parameter passed to HC256 init - " + Platform.GetTypeName(parameters), "parameters"); } diff --git a/crypto/src/crypto/engines/ISAACEngine.cs b/crypto/src/crypto/engines/ISAACEngine.cs index f25577130..b94ee6ed9 100644 --- a/crypto/src/crypto/engines/ISAACEngine.cs +++ b/crypto/src/crypto/engines/ISAACEngine.cs @@ -2,6 +2,7 @@ using System; using Org.BouncyCastle.Crypto.Parameters; using Org.BouncyCastle.Crypto.Utilities; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Crypto.Engines { @@ -41,7 +42,7 @@ namespace Org.BouncyCastle.Crypto.Engines { if (!(parameters is KeyParameter)) throw new ArgumentException( - "invalid parameter passed to ISAAC Init - " + parameters.GetType().Name, + "invalid parameter passed to ISAAC Init - " + Platform.GetTypeName(parameters), "parameters"); /* diff --git a/crypto/src/crypto/engines/IdeaEngine.cs b/crypto/src/crypto/engines/IdeaEngine.cs index 4909510ac..18a151c93 100644 --- a/crypto/src/crypto/engines/IdeaEngine.cs +++ b/crypto/src/crypto/engines/IdeaEngine.cs @@ -1,6 +1,7 @@ using System; using Org.BouncyCastle.Crypto.Parameters; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Crypto.Engines { @@ -52,7 +53,7 @@ namespace Org.BouncyCastle.Crypto.Engines ICipherParameters parameters) { if (!(parameters is KeyParameter)) - throw new ArgumentException("invalid parameter passed to IDEA init - " + parameters.GetType().ToString()); + throw new ArgumentException("invalid parameter passed to IDEA init - " + Platform.GetTypeName(parameters)); workingKey = GenerateWorkingKey(forEncryption, ((KeyParameter)parameters).GetKey()); diff --git a/crypto/src/crypto/engines/NoekeonEngine.cs b/crypto/src/crypto/engines/NoekeonEngine.cs index dd78a4ea5..f64be50ba 100644 --- a/crypto/src/crypto/engines/NoekeonEngine.cs +++ b/crypto/src/crypto/engines/NoekeonEngine.cs @@ -2,6 +2,7 @@ using System; using Org.BouncyCastle.Crypto.Parameters; using Org.BouncyCastle.Crypto.Utilities; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Crypto.Engines { @@ -70,7 +71,8 @@ namespace Org.BouncyCastle.Crypto.Engines ICipherParameters parameters) { if (!(parameters is KeyParameter)) - throw new ArgumentException("Invalid parameters passed to Noekeon init - " + parameters.GetType().Name, "parameters"); + throw new ArgumentException("Invalid parameters passed to Noekeon init - " + + Platform.GetTypeName(parameters), "parameters"); _forEncryption = forEncryption; _initialised = true; diff --git a/crypto/src/crypto/engines/RC2Engine.cs b/crypto/src/crypto/engines/RC2Engine.cs index b56953de5..4aca1894f 100644 --- a/crypto/src/crypto/engines/RC2Engine.cs +++ b/crypto/src/crypto/engines/RC2Engine.cs @@ -1,6 +1,7 @@ using System; using Org.BouncyCastle.Crypto.Parameters; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Crypto.Engines { @@ -135,7 +136,7 @@ namespace Org.BouncyCastle.Crypto.Engines } else { - throw new ArgumentException("invalid parameter passed to RC2 init - " + parameters.GetType().Name); + throw new ArgumentException("invalid parameter passed to RC2 init - " + Platform.GetTypeName(parameters)); } } diff --git a/crypto/src/crypto/engines/RC4Engine.cs b/crypto/src/crypto/engines/RC4Engine.cs index fd84b7d23..a515bb04e 100644 --- a/crypto/src/crypto/engines/RC4Engine.cs +++ b/crypto/src/crypto/engines/RC4Engine.cs @@ -1,6 +1,7 @@ using System; using Org.BouncyCastle.Crypto.Parameters; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Crypto.Engines { @@ -44,7 +45,7 @@ namespace Org.BouncyCastle.Crypto.Engines return; } - throw new ArgumentException("invalid parameter passed to RC4 init - " + parameters.GetType().ToString()); + throw new ArgumentException("invalid parameter passed to RC4 init - " + Platform.GetTypeName(parameters)); } public virtual string AlgorithmName diff --git a/crypto/src/crypto/engines/RC532Engine.cs b/crypto/src/crypto/engines/RC532Engine.cs index 169a60b98..d1c29e624 100644 --- a/crypto/src/crypto/engines/RC532Engine.cs +++ b/crypto/src/crypto/engines/RC532Engine.cs @@ -1,6 +1,7 @@ using System; using Org.BouncyCastle.Crypto.Parameters; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Crypto.Engines { @@ -91,7 +92,7 @@ namespace Org.BouncyCastle.Crypto.Engines } else { - throw new ArgumentException("invalid parameter passed to RC532 init - " + parameters.GetType().ToString()); + throw new ArgumentException("invalid parameter passed to RC532 init - " + Platform.GetTypeName(parameters)); } this.forEncryption = forEncryption; diff --git a/crypto/src/crypto/engines/RC564Engine.cs b/crypto/src/crypto/engines/RC564Engine.cs index ddcce0fa8..097fd60ba 100644 --- a/crypto/src/crypto/engines/RC564Engine.cs +++ b/crypto/src/crypto/engines/RC564Engine.cs @@ -1,6 +1,7 @@ using System; using Org.BouncyCastle.Crypto.Parameters; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Crypto.Engines { @@ -80,7 +81,7 @@ namespace Org.BouncyCastle.Crypto.Engines { if (!(typeof(RC5Parameters).IsInstanceOfType(parameters))) { - throw new ArgumentException("invalid parameter passed to RC564 init - " + parameters.GetType().ToString()); + throw new ArgumentException("invalid parameter passed to RC564 init - " + Platform.GetTypeName(parameters)); } RC5Parameters p = (RC5Parameters)parameters; diff --git a/crypto/src/crypto/engines/RC6Engine.cs b/crypto/src/crypto/engines/RC6Engine.cs index 196bd8394..9aeb1e7cb 100644 --- a/crypto/src/crypto/engines/RC6Engine.cs +++ b/crypto/src/crypto/engines/RC6Engine.cs @@ -1,6 +1,7 @@ using System; using Org.BouncyCastle.Crypto.Parameters; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Crypto.Engines { @@ -76,7 +77,7 @@ namespace Org.BouncyCastle.Crypto.Engines ICipherParameters parameters) { if (!(parameters is KeyParameter)) - throw new ArgumentException("invalid parameter passed to RC6 init - " + parameters.GetType().ToString()); + throw new ArgumentException("invalid parameter passed to RC6 init - " + Platform.GetTypeName(parameters)); this.forEncryption = forEncryption; diff --git a/crypto/src/crypto/engines/RijndaelEngine.cs b/crypto/src/crypto/engines/RijndaelEngine.cs index 80f522353..7025cb5dc 100644 --- a/crypto/src/crypto/engines/RijndaelEngine.cs +++ b/crypto/src/crypto/engines/RijndaelEngine.cs @@ -1,6 +1,7 @@ using System; using Org.BouncyCastle.Crypto.Parameters; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Crypto.Engines { @@ -582,7 +583,7 @@ namespace Org.BouncyCastle.Crypto.Engines return; } - throw new ArgumentException("invalid parameter passed to Rijndael init - " + parameters.GetType().ToString()); + throw new ArgumentException("invalid parameter passed to Rijndael init - " + Platform.GetTypeName(parameters)); } public virtual string AlgorithmName diff --git a/crypto/src/crypto/engines/SerpentEngineBase.cs b/crypto/src/crypto/engines/SerpentEngineBase.cs index a4c686922..a5d91b3be 100644 --- a/crypto/src/crypto/engines/SerpentEngineBase.cs +++ b/crypto/src/crypto/engines/SerpentEngineBase.cs @@ -1,6 +1,7 @@ using System; using Org.BouncyCastle.Crypto.Parameters; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Crypto.Engines { @@ -32,7 +33,7 @@ namespace Org.BouncyCastle.Crypto.Engines public virtual void Init(bool encrypting, ICipherParameters parameters) { if (!(parameters is KeyParameter)) - throw new ArgumentException("invalid parameter passed to " + AlgorithmName + " init - " + parameters.GetType().ToString()); + throw new ArgumentException("invalid parameter passed to " + AlgorithmName + " init - " + Platform.GetTypeName(parameters)); this.encrypting = encrypting; this.wKey = MakeWorkingKey(((KeyParameter)parameters).GetKey()); diff --git a/crypto/src/crypto/engines/SkipjackEngine.cs b/crypto/src/crypto/engines/SkipjackEngine.cs index a45dc9b24..c90646cc4 100644 --- a/crypto/src/crypto/engines/SkipjackEngine.cs +++ b/crypto/src/crypto/engines/SkipjackEngine.cs @@ -1,6 +1,7 @@ using System; using Org.BouncyCastle.Crypto.Parameters; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Crypto.Engines { @@ -48,7 +49,7 @@ namespace Org.BouncyCastle.Crypto.Engines ICipherParameters parameters) { if (!(parameters is KeyParameter)) - throw new ArgumentException("invalid parameter passed to SKIPJACK init - " + parameters.GetType().ToString()); + throw new ArgumentException("invalid parameter passed to SKIPJACK init - " + Platform.GetTypeName(parameters)); byte[] keyBytes = ((KeyParameter)parameters).GetKey(); diff --git a/crypto/src/crypto/engines/TEAEngine.cs b/crypto/src/crypto/engines/TEAEngine.cs index 2e1a7002b..7b700145e 100644 --- a/crypto/src/crypto/engines/TEAEngine.cs +++ b/crypto/src/crypto/engines/TEAEngine.cs @@ -2,6 +2,7 @@ using System; using Org.BouncyCastle.Crypto.Parameters; using Org.BouncyCastle.Crypto.Utilities; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Crypto.Engines { @@ -66,7 +67,7 @@ namespace Org.BouncyCastle.Crypto.Engines if (!(parameters is KeyParameter)) { throw new ArgumentException("invalid parameter passed to TEA init - " - + parameters.GetType().FullName); + + Platform.GetTypeName(parameters)); } _forEncryption = forEncryption; diff --git a/crypto/src/crypto/engines/ThreefishEngine.cs b/crypto/src/crypto/engines/ThreefishEngine.cs index 33ff3a421..eade3cc72 100644 --- a/crypto/src/crypto/engines/ThreefishEngine.cs +++ b/crypto/src/crypto/engines/ThreefishEngine.cs @@ -2,6 +2,7 @@ using System; using Org.BouncyCastle.Crypto.Parameters; using Org.BouncyCastle.Crypto.Utilities; +using Org.BouncyCastle.Utilities; using Org.BouncyCastle.Utilities.Encoders; namespace Org.BouncyCastle.Crypto.Engines @@ -174,7 +175,7 @@ namespace Org.BouncyCastle.Crypto.Engines else { throw new ArgumentException("Invalid parameter passed to Threefish init - " - + parameters.GetType().Name); + + Platform.GetTypeName(parameters)); } ulong[] keyWords = null; diff --git a/crypto/src/crypto/engines/TwofishEngine.cs b/crypto/src/crypto/engines/TwofishEngine.cs index 04a579ced..71c246594 100644 --- a/crypto/src/crypto/engines/TwofishEngine.cs +++ b/crypto/src/crypto/engines/TwofishEngine.cs @@ -1,6 +1,7 @@ using System; using Org.BouncyCastle.Crypto.Parameters; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Crypto.Engines { @@ -267,7 +268,7 @@ namespace Org.BouncyCastle.Crypto.Engines ICipherParameters parameters) { if (!(parameters is KeyParameter)) - throw new ArgumentException("invalid parameter passed to Twofish init - " + parameters.GetType().ToString()); + throw new ArgumentException("invalid parameter passed to Twofish init - " + Platform.GetTypeName(parameters)); this.encrypting = forEncryption; this.workingKey = ((KeyParameter)parameters).GetKey(); diff --git a/crypto/src/crypto/engines/XTEAEngine.cs b/crypto/src/crypto/engines/XTEAEngine.cs index 40d81fbe6..5fcfa4a57 100644 --- a/crypto/src/crypto/engines/XTEAEngine.cs +++ b/crypto/src/crypto/engines/XTEAEngine.cs @@ -2,6 +2,7 @@ using System; using Org.BouncyCastle.Crypto.Parameters; using Org.BouncyCastle.Crypto.Utilities; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Crypto.Engines { @@ -64,7 +65,7 @@ namespace Org.BouncyCastle.Crypto.Engines if (!(parameters is KeyParameter)) { throw new ArgumentException("invalid parameter passed to TEA init - " - + parameters.GetType().FullName); + + Platform.GetTypeName(parameters)); } _forEncryption = forEncryption; diff --git a/crypto/src/crypto/macs/GOST28147Mac.cs b/crypto/src/crypto/macs/GOST28147Mac.cs index 9a8f1b730..cc6b723d6 100644 --- a/crypto/src/crypto/macs/GOST28147Mac.cs +++ b/crypto/src/crypto/macs/GOST28147Mac.cs @@ -2,6 +2,7 @@ using System; using Org.BouncyCastle.Crypto; using Org.BouncyCastle.Crypto.Parameters; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Crypto.Macs { @@ -83,7 +84,7 @@ namespace Org.BouncyCastle.Crypto.Macs else { throw new ArgumentException("invalid parameter passed to Gost28147 init - " - + parameters.GetType().Name); + + Platform.GetTypeName(parameters)); } } diff --git a/crypto/src/crypto/macs/SkeinMac.cs b/crypto/src/crypto/macs/SkeinMac.cs index 1d61a41ca..07eff24f4 100644 --- a/crypto/src/crypto/macs/SkeinMac.cs +++ b/crypto/src/crypto/macs/SkeinMac.cs @@ -3,6 +3,7 @@ using System; using Org.BouncyCastle.Crypto.Digests; using Org.BouncyCastle.Crypto.Parameters; using Org.BouncyCastle.Crypto.Utilities; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Crypto.Macs { @@ -79,7 +80,7 @@ namespace Org.BouncyCastle.Crypto.Macs else { throw new ArgumentException("Invalid parameter passed to Skein MAC init - " - + parameters.GetType().Name); + + Platform.GetTypeName(parameters)); } if (skeinParameters.GetKey() == null) { diff --git a/crypto/src/crypto/tls/DefaultTlsAgreementCredentials.cs b/crypto/src/crypto/tls/DefaultTlsAgreementCredentials.cs index 5147a1990..fab978886 100644 --- a/crypto/src/crypto/tls/DefaultTlsAgreementCredentials.cs +++ b/crypto/src/crypto/tls/DefaultTlsAgreementCredentials.cs @@ -40,7 +40,7 @@ namespace Org.BouncyCastle.Crypto.Tls } else { - throw new ArgumentException("type not supported: " + privateKey.GetType().FullName, "privateKey"); + throw new ArgumentException("type not supported: " + Platform.GetTypeName(privateKey), "privateKey"); } this.mCertificate = certificate; diff --git a/crypto/src/crypto/tls/DefaultTlsEncryptionCredentials.cs b/crypto/src/crypto/tls/DefaultTlsEncryptionCredentials.cs index 34d15d146..5348ee88d 100644 --- a/crypto/src/crypto/tls/DefaultTlsEncryptionCredentials.cs +++ b/crypto/src/crypto/tls/DefaultTlsEncryptionCredentials.cs @@ -2,6 +2,7 @@ using System.IO; using Org.BouncyCastle.Crypto.Parameters; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Crypto.Tls { @@ -29,7 +30,7 @@ namespace Org.BouncyCastle.Crypto.Tls } else { - throw new ArgumentException("type not supported: " + privateKey.GetType().FullName, "privateKey"); + throw new ArgumentException("type not supported: " + Platform.GetTypeName(privateKey), "privateKey"); } this.mContext = context; diff --git a/crypto/src/crypto/tls/DefaultTlsSignerCredentials.cs b/crypto/src/crypto/tls/DefaultTlsSignerCredentials.cs index c7a136573..0ff732a97 100644 --- a/crypto/src/crypto/tls/DefaultTlsSignerCredentials.cs +++ b/crypto/src/crypto/tls/DefaultTlsSignerCredentials.cs @@ -2,6 +2,7 @@ using System; using System.IO; using Org.BouncyCastle.Crypto.Parameters; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Crypto.Tls { @@ -48,7 +49,7 @@ namespace Org.BouncyCastle.Crypto.Tls } else { - throw new ArgumentException("type not supported: " + privateKey.GetType().FullName, "privateKey"); + throw new ArgumentException("type not supported: " + Platform.GetTypeName(privateKey), "privateKey"); } this.mSigner.Init(context); diff --git a/crypto/src/openpgp/PgpPublicKeyRingBundle.cs b/crypto/src/openpgp/PgpPublicKeyRingBundle.cs index e73848439..91113e904 100644 --- a/crypto/src/openpgp/PgpPublicKeyRingBundle.cs +++ b/crypto/src/openpgp/PgpPublicKeyRingBundle.cs @@ -52,7 +52,7 @@ namespace Org.BouncyCastle.Bcpg.OpenPgp if (pgpPub == null) { - throw new PgpException(obj.GetType().FullName + " found where PgpPublicKeyRing expected"); + throw new PgpException(Platform.GetTypeName(obj) + " found where PgpPublicKeyRing expected"); } long key = pgpPub.GetPublicKey().KeyId; diff --git a/crypto/src/openpgp/PgpSecretKeyRingBundle.cs b/crypto/src/openpgp/PgpSecretKeyRingBundle.cs index b0df0ed3f..c9f4d3959 100644 --- a/crypto/src/openpgp/PgpSecretKeyRingBundle.cs +++ b/crypto/src/openpgp/PgpSecretKeyRingBundle.cs @@ -1,6 +1,5 @@ using System; using System.Collections; -using System.Globalization; using System.IO; using Org.BouncyCastle.Utilities; @@ -53,7 +52,7 @@ namespace Org.BouncyCastle.Bcpg.OpenPgp if (pgpSecret == null) { - throw new PgpException(obj.GetType().FullName + " found where PgpSecretKeyRing expected"); + throw new PgpException(Platform.GetTypeName(obj) + " found where PgpSecretKeyRing expected"); } long key = pgpSecret.GetPublicKey().KeyId; diff --git a/crypto/src/openssl/MiscPemGenerator.cs b/crypto/src/openssl/MiscPemGenerator.cs index 443e446f7..22ae1eae1 100644 --- a/crypto/src/openssl/MiscPemGenerator.cs +++ b/crypto/src/openssl/MiscPemGenerator.cs @@ -3,7 +3,6 @@ using System.Collections; using System.IO; using Org.BouncyCastle.Asn1; -using Org.BouncyCastle.Asn1.Cms; using Org.BouncyCastle.Asn1.CryptoPro; using Org.BouncyCastle.Asn1.Pkcs; using Org.BouncyCastle.Asn1.X509; @@ -127,7 +126,7 @@ namespace Org.BouncyCastle.OpenSsl } else { - throw new PemGenerationException("Object type not supported: " + obj.GetType().FullName); + throw new PemGenerationException("Object type not supported: " + Platform.GetTypeName(obj)); } return new PemObject(type, encoding); @@ -185,7 +184,7 @@ namespace Org.BouncyCastle.OpenSsl if (type == null || keyData == null) { // TODO Support other types? - throw new PemGenerationException("Object type not supported: " + obj.GetType().FullName); + throw new PemGenerationException("Object type not supported: " + Platform.GetTypeName(obj)); } @@ -250,7 +249,7 @@ namespace Org.BouncyCastle.OpenSsl } else { - throw new ArgumentException("Cannot handle private key of type: " + akp.GetType().FullName, "akp"); + throw new ArgumentException("Cannot handle private key of type: " + Platform.GetTypeName(akp), "akp"); } return info.ParsePrivateKey().GetEncoded(); diff --git a/crypto/src/pkcs/PrivateKeyInfoFactory.cs b/crypto/src/pkcs/PrivateKeyInfoFactory.cs index aafc4c292..a349a11d2 100644 --- a/crypto/src/pkcs/PrivateKeyInfoFactory.cs +++ b/crypto/src/pkcs/PrivateKeyInfoFactory.cs @@ -173,7 +173,7 @@ namespace Org.BouncyCastle.Pkcs return new PrivateKeyInfo(algID, new DerOctetString(keyBytes)); } - throw new ArgumentException("Class provided is not convertible: " + key.GetType().FullName); + throw new ArgumentException("Class provided is not convertible: " + Platform.GetTypeName(key)); } public static PrivateKeyInfo CreatePrivateKeyInfo( diff --git a/crypto/src/pkix/PkixCertPathBuilder.cs b/crypto/src/pkix/PkixCertPathBuilder.cs index 7082fe409..fa38a5ec0 100644 --- a/crypto/src/pkix/PkixCertPathBuilder.cs +++ b/crypto/src/pkix/PkixCertPathBuilder.cs @@ -42,7 +42,7 @@ namespace Org.BouncyCastle.Pkix throw new PkixCertPathBuilderException( "TargetConstraints must be an instance of " + typeof(X509CertStoreSelector).FullName + " for " - + this.GetType() + " class."); + + Platform.GetTypeName(this) + " class."); } ISet targets = new HashSet(); diff --git a/crypto/src/pkix/PkixParameters.cs b/crypto/src/pkix/PkixParameters.cs index 47d3b5e37..01ed9d4fa 100644 --- a/crypto/src/pkix/PkixParameters.cs +++ b/crypto/src/pkix/PkixParameters.cs @@ -737,7 +737,7 @@ namespace Org.BouncyCastle.Pkix if (!(obj is TrustAnchor)) { throw new InvalidCastException("All elements of set must be " - + "of type " + typeof(TrustAnchor).Name + "."); + + "of type " + typeof(TrustAnchor).FullName + "."); } } this.trustedACIssuers = new HashSet(trustedACIssuers); diff --git a/crypto/src/util/Platform.cs b/crypto/src/util/Platform.cs index 361fe7536..86484854d 100644 --- a/crypto/src/util/Platform.cs +++ b/crypto/src/util/Platform.cs @@ -220,5 +220,10 @@ namespace Org.BouncyCastle.Utilities { return InvariantCompareInfo.IsSuffix(source, suffix, CompareOptions.Ordinal); } + + internal static string GetTypeName(object obj) + { + return obj.GetType().FullName; + } } } diff --git a/crypto/src/x509/SubjectPublicKeyInfoFactory.cs b/crypto/src/x509/SubjectPublicKeyInfoFactory.cs index bb6f37831..7614321d4 100644 --- a/crypto/src/x509/SubjectPublicKeyInfoFactory.cs +++ b/crypto/src/x509/SubjectPublicKeyInfoFactory.cs @@ -1,7 +1,4 @@ using System; -using System.IO; -using System.Collections; -using System.Text; using Org.BouncyCastle.Crypto.Parameters; using Org.BouncyCastle.Asn1; @@ -167,7 +164,7 @@ namespace Org.BouncyCastle.X509 return new SubjectPublicKeyInfo(algID, new DerOctetString(keyBytes)); } - throw new ArgumentException("Class provided no convertible: " + key.GetType().FullName); + throw new ArgumentException("Class provided no convertible: " + Platform.GetTypeName(key)); } private static void ExtractBytes( |