diff options
author | Peter Dettman <peter.dettman@bouncycastle.org> | 2024-04-19 19:06:42 +0700 |
---|---|---|
committer | Peter Dettman <peter.dettman@bouncycastle.org> | 2024-04-19 19:06:42 +0700 |
commit | a0a628465317a7a4cf786eb2279efea65b6f9005 (patch) | |
tree | 1400b324072e2c29fa279885339cdbd5bbe1db6f /crypto/src/tsp | |
parent | Improve LMS parsing (diff) | |
download | BouncyCastle.NET-ed25519-a0a628465317a7a4cf786eb2279efea65b6f9005.tar.xz |
Refactor TimeStampRequest
Diffstat (limited to 'crypto/src/tsp')
-rw-r--r-- | crypto/src/tsp/TimeStampRequest.cs | 34 |
1 files changed, 7 insertions, 27 deletions
diff --git a/crypto/src/tsp/TimeStampRequest.cs b/crypto/src/tsp/TimeStampRequest.cs index b05b58c0e..2cef1ae94 100644 --- a/crypto/src/tsp/TimeStampRequest.cs +++ b/crypto/src/tsp/TimeStampRequest.cs @@ -18,13 +18,11 @@ namespace Org.BouncyCastle.Tsp : X509ExtensionBase { private TimeStampReq req; - private X509Extensions extensions; public TimeStampRequest( TimeStampReq req) { this.req = req; - this.extensions = req.Extensions; } /** @@ -148,34 +146,16 @@ namespace Org.BouncyCastle.Tsp /** * return the ASN.1 encoded representation of this object. */ - public byte[] GetEncoded() - { - return req.GetEncoded(); - } + public byte[] GetEncoded() => req.GetEncoded(); - internal X509Extensions Extensions - { - get { return req.Extensions; } - } - - public virtual bool HasExtensions - { - get { return extensions != null; } - } + internal X509Extensions Extensions => req.Extensions; - public virtual X509Extension GetExtension(DerObjectIdentifier oid) - { - return extensions == null ? null : extensions.GetExtension(oid); - } + public virtual bool HasExtensions => Extensions != null; - public virtual IList<DerObjectIdentifier> GetExtensionOids() - { - return TspUtil.GetExtensionOids(extensions); - } + public virtual X509Extension GetExtension(DerObjectIdentifier oid) => Extensions?.GetExtension(oid); - protected override X509Extensions GetX509Extensions() - { - return Extensions; - } + public virtual IList<DerObjectIdentifier> GetExtensionOids() => TspUtil.GetExtensionOids(Extensions); + + protected override X509Extensions GetX509Extensions() => Extensions; } } |