diff options
Diffstat (limited to 'crypto/src/asn1/tsp/TimeStampReq.cs')
-rw-r--r-- | crypto/src/asn1/tsp/TimeStampReq.cs | 26 |
1 files changed, 9 insertions, 17 deletions
diff --git a/crypto/src/asn1/tsp/TimeStampReq.cs b/crypto/src/asn1/tsp/TimeStampReq.cs index b71fe83ab..7173172c4 100644 --- a/crypto/src/asn1/tsp/TimeStampReq.cs +++ b/crypto/src/asn1/tsp/TimeStampReq.cs @@ -15,24 +15,16 @@ namespace Org.BouncyCastle.Asn1.Tsp private readonly DerBoolean certReq; private readonly X509Extensions extensions; - public static TimeStampReq GetInstance( - object o) - { - if (o == null || o is TimeStampReq) - { - return (TimeStampReq) o; - } - - if (o is Asn1Sequence) - { - return new TimeStampReq((Asn1Sequence) o); - } - - throw new ArgumentException( - "Unknown object in 'TimeStampReq' factory: " + Platform.GetTypeName(o)); - } + public static TimeStampReq GetInstance(object obj) + { + if (obj is TimeStampReq) + return (TimeStampReq)obj; + if (obj == null) + return null; + return new TimeStampReq(Asn1Sequence.GetInstance(obj)); + } - private TimeStampReq( + private TimeStampReq( Asn1Sequence seq) { int nbObjects = seq.Count; |