Skip to content

Commit 19c2126

Browse files
committed
x509-cert: AKI is now an owned type
1 parent 97051a5 commit 19c2126

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

x509-cert/src/ext/pkix/authkeyid.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use crate::serial_number::SerialNumber;
33

44
use const_oid::db::rfc5280::ID_CE_AUTHORITY_KEY_IDENTIFIER;
55
use const_oid::{AssociatedOid, ObjectIdentifier};
6-
use der::asn1::OctetStringRef;
6+
use der::asn1::OctetString;
77
use der::Sequence;
88

99
/// AuthorityKeyIdentifier as defined in [RFC 5280 Section 4.2.1.1].
@@ -21,9 +21,9 @@ use der::Sequence;
2121
/// [RFC 5280 Section 4.2.1.1]: https://datatracker.ietf.org/doc/html/rfc5280#section-4.2.1.1
2222
#[derive(Clone, Debug, Eq, PartialEq, Sequence)]
2323
#[allow(missing_docs)]
24-
pub struct AuthorityKeyIdentifier<'a> {
24+
pub struct AuthorityKeyIdentifier {
2525
#[asn1(context_specific = "0", tag_mode = "IMPLICIT", optional = "true")]
26-
pub key_identifier: Option<OctetStringRef<'a>>,
26+
pub key_identifier: Option<OctetString>,
2727

2828
#[asn1(context_specific = "1", tag_mode = "IMPLICIT", optional = "true")]
2929
pub authority_cert_issuer: Option<GeneralNames>,
@@ -32,6 +32,6 @@ pub struct AuthorityKeyIdentifier<'a> {
3232
pub authority_cert_serial_number: Option<SerialNumber>,
3333
}
3434

35-
impl<'a> AssociatedOid for AuthorityKeyIdentifier<'a> {
35+
impl AssociatedOid for AuthorityKeyIdentifier {
3636
const OID: ObjectIdentifier = ID_CE_AUTHORITY_KEY_IDENTIFIER;
3737
}

x509-cert/tests/pkix_extensions.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,7 @@ fn decode_cert() {
525525
let akid = AuthorityKeyIdentifier::from_der(ext.extn_value.as_bytes()).unwrap();
526526
assert_eq!(
527527
&hex!("7C4C863AB80BD589870BEDB7E11BBD2A08BB3D23FF"),
528-
akid.key_identifier.unwrap().as_bytes()
528+
akid.key_identifier.as_ref().unwrap().as_bytes()
529529
);
530530

531531
let reencoded = akid.to_vec().and_then(OctetString::new).unwrap();

0 commit comments

Comments
 (0)