Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion pkcs8/src/private_key_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use core::fmt;
use der::{
Decode, DecodeValue, Encode, EncodeValue, FixedTag, Header, Length, Reader, Sequence, TagMode,
TagNumber, Writer,
asn1::{AnyRef, BitStringRef, ContextSpecific, OctetStringRef},
asn1::{AnyRef, BitStringRef, ContextSpecific, OctetStringRef, SequenceRef},
};
use spki::AlgorithmIdentifier;

Expand All @@ -26,6 +26,9 @@ use der::pem::PemLabel;
#[cfg(feature = "subtle")]
use subtle::{Choice, ConstantTimeEq};

/// Context-specific tag number for attributes.
const ATTRIBUTES_TAG: TagNumber = TagNumber(0);

/// Context-specific tag number for the public key.
const PUBLIC_KEY_TAG: TagNumber = TagNumber(1);

Expand Down Expand Up @@ -199,6 +202,10 @@ where
let version = Version::decode(reader)?;
let algorithm = reader.decode()?;
let private_key = Key::decode(reader)?;

let _attributes =
reader.context_specific::<SequenceRef<'_>>(ATTRIBUTES_TAG, TagMode::Implicit)?;

let public_key =
reader.context_specific::<PubKey>(PUBLIC_KEY_TAG, TagMode::Implicit)?;

Expand Down