pub type PrivateKeyInfoRef<'a> = PrivateKeyInfo<AnyRef<'a>, &'a OctetStringRef, BitStringRef<'a>>;Expand description
PrivateKeyInfo with AnyRef algorithm parameters, and &[u8] key.
Aliased Type§
pub struct PrivateKeyInfoRef<'a> {
pub algorithm: AlgorithmIdentifier<AnyRef<'a>>,
pub private_key: &'a OctetStringRef,
pub public_key: Option<BitStringRef<'a>>,
}Fields§
§algorithm: AlgorithmIdentifier<AnyRef<'a>>X.509 AlgorithmIdentifier for the private key type.
private_key: &'a OctetStringRefPrivate key data. Exact content format is different between algorithms.
public_key: Option<BitStringRef<'a>>Public key data, optionally available if version is V2.
Trait Implementations§
Source§impl EncodePrivateKey for PrivateKeyInfoRef<'_>
impl EncodePrivateKey for PrivateKeyInfoRef<'_>
Source§fn to_pkcs8_der(&self) -> Result<SecretDocument>
fn to_pkcs8_der(&self) -> Result<SecretDocument>
Serialize a
SecretDocument containing a PKCS#8-encoded private key. Read moreSource§fn to_pkcs8_pem(&self, line_ending: LineEnding) -> Result<Zeroizing<String>>
fn to_pkcs8_pem(&self, line_ending: LineEnding) -> Result<Zeroizing<String>>
Serialize this private key as PEM-encoded PKCS#8 with the given
LineEnding. Read moreSource§fn write_pkcs8_der_file(&self, path: impl AsRef<Path>) -> Result<()>
fn write_pkcs8_der_file(&self, path: impl AsRef<Path>) -> Result<()>
Write ASN.1 DER-encoded PKCS#8 private key to the given path. Read more
Source§fn write_pkcs8_pem_file(
&self,
path: impl AsRef<Path>,
line_ending: LineEnding,
) -> Result<()>
fn write_pkcs8_pem_file( &self, path: impl AsRef<Path>, line_ending: LineEnding, ) -> Result<()>
Write ASN.1 PEM-encoded PKCS#8 private key to the given path. Read more
Source§impl<'a> RefToOwned<'a> for PrivateKeyInfoRef<'a>
impl<'a> RefToOwned<'a> for PrivateKeyInfoRef<'a>
Source§type Owned = PrivateKeyInfo<Any, OctetString, BitString>
type Owned = PrivateKeyInfo<Any, OctetString, BitString>
The resulting type after obtaining ownership.
Source§fn ref_to_owned(&self) -> Self::Owned
fn ref_to_owned(&self) -> Self::Owned
Creates a new object taking ownership of the data