diff options
author | Peter Dettman <peter.dettman@bouncycastle.org> | 2020-02-21 18:04:07 +0700 |
---|---|---|
committer | Peter Dettman <peter.dettman@bouncycastle.org> | 2020-02-21 18:04:07 +0700 |
commit | b204309029cd6bd92d8a20e5778e6cf328bf7745 (patch) | |
tree | da220b61292493a744a210c2c7e00740468838a2 /crypto/src/asn1/tsp/Accuracy.cs | |
parent | Improvements to permitted sub-trees (diff) | |
download | BouncyCastle.NET-ed25519-b204309029cd6bd92d8a20e5778e6cf328bf7745.tar.xz |
Update ASN.1 GetInstance methods
Diffstat (limited to 'crypto/src/asn1/tsp/Accuracy.cs')
-rw-r--r-- | crypto/src/asn1/tsp/Accuracy.cs | 26 |
1 files changed, 9 insertions, 17 deletions
diff --git a/crypto/src/asn1/tsp/Accuracy.cs b/crypto/src/asn1/tsp/Accuracy.cs index 31289db99..0cbc731ac 100644 --- a/crypto/src/asn1/tsp/Accuracy.cs +++ b/crypto/src/asn1/tsp/Accuracy.cs @@ -75,24 +75,16 @@ namespace Org.BouncyCastle.Asn1.Tsp } } - public static Accuracy GetInstance( - object o) - { - if (o == null || o is Accuracy) - { - return (Accuracy) o; - } - - if (o is Asn1Sequence) - { - return new Accuracy((Asn1Sequence) o); - } - - throw new ArgumentException( - "Unknown object in 'Accuracy' factory: " + Platform.GetTypeName(o)); - } + public static Accuracy GetInstance(object obj) + { + if (obj is Accuracy) + return (Accuracy)obj; + if (obj == null) + return null; + return new Accuracy(Asn1Sequence.GetInstance(obj)); + } - public DerInteger Seconds + public DerInteger Seconds { get { return seconds; } } |