Skip to content

Commit b79a4c1

Browse files
authored
der: add Any::value accessor (#833)
* add value function to Any. change BasicOcspResponse to use AlgorithmIdentifierOwned (the repo needs similar owned treatment as x509-cert but changing this one field is an immediate need). * address clippy warning
1 parent 4e2266e commit b79a4c1

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

der/src/asn1/any.rs

+5
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,11 @@ impl Any {
184184
Ok(Self { tag, value })
185185
}
186186

187+
/// Allow access to value
188+
pub fn value(&self) -> &[u8] {
189+
self.value.as_slice()
190+
}
191+
187192
/// Attempt to decode this [`Any`] type into the inner value.
188193
pub fn decode_as<'a, T>(&'a self) -> Result<T>
189194
where

x509-ocsp/src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ extern crate alloc;
1616
use der::asn1::{BitStringRef, Ia5StringRef, ObjectIdentifier, OctetStringRef, UintRef};
1717
use der::asn1::{GeneralizedTime, Null};
1818
use der::{AnyRef, Choice, Enumerated, Sequence};
19-
use spki::AlgorithmIdentifierRef;
19+
use spki::{AlgorithmIdentifierOwned, AlgorithmIdentifierRef};
2020
use x509_cert::ext::pkix::name::GeneralName;
2121
use x509_cert::ext::pkix::{AuthorityInfoAccessSyntax, CrlReason};
2222
use x509_cert::ext::Extensions;
@@ -242,7 +242,7 @@ pub struct ResponseBytes<'a> {
242242
#[allow(missing_docs)]
243243
pub struct BasicOcspResponse<'a> {
244244
pub tbs_response_data: ResponseData<'a>,
245-
pub signature_algorithm: AlgorithmIdentifierRef<'a>,
245+
pub signature_algorithm: AlgorithmIdentifierOwned,
246246
pub signature: BitStringRef<'a>,
247247

248248
#[asn1(context_specific = "0", optional = "true", tag_mode = "EXPLICIT")]

0 commit comments

Comments
 (0)