diff options
Diffstat (limited to 'crypto/src/asn1/DerUTCTime.cs')
-rw-r--r-- | crypto/src/asn1/DerUTCTime.cs | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/crypto/src/asn1/DerUTCTime.cs b/crypto/src/asn1/DerUTCTime.cs index 089285367..33e502c67 100644 --- a/crypto/src/asn1/DerUTCTime.cs +++ b/crypto/src/asn1/DerUTCTime.cs @@ -5,21 +5,36 @@ namespace Org.BouncyCastle.Asn1 public class DerUtcTime : Asn1UtcTime { - public DerUtcTime(string time) - : base(time) + public DerUtcTime(string timeString) + : base(timeString) { } - public DerUtcTime(DateTime time) - : base(time) + [Obsolete("Use `DerUtcTime(DateTime, int)' instead")] + public DerUtcTime(DateTime dateTime) + : base(dateTime) { } - internal DerUtcTime(byte[] contents) + public DerUtcTime(DateTime dateTime, int twoDigitYearMax) + : base(dateTime, twoDigitYearMax) + { + } + + internal DerUtcTime(byte[] contents) : base(contents) { } - // TODO: create proper DER encoding. + internal override IAsn1Encoding GetEncoding(int encoding) + { + return new PrimitiveEncoding(Asn1Tags.Universal, Asn1Tags.UtcTime, + GetContents(Asn1OutputStream.EncodingDer)); + } + + internal override IAsn1Encoding GetEncodingImplicit(int encoding, int tagClass, int tagNo) + { + return new PrimitiveEncoding(tagClass, tagNo, GetContents(Asn1OutputStream.EncodingDer)); + } } } |