aws_lc_rs/
pkcs8.rs

1// Copyright 2017 Brian Smith.
2// SPDX-License-Identifier: ISC
3// Modifications copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
4// SPDX-License-Identifier: Apache-2.0 OR ISC
5
6//! PKCS#8 is specified in [RFC 5208].
7//!
8//! [RFC 5208]: https://tools.ietf.org/html/rfc5208.
9
10use zeroize::Zeroize;
11
12/// A generated PKCS#8 document.
13pub struct Document {
14    bytes: Vec<u8>,
15}
16
17impl Document {
18    pub(crate) fn new(bytes: Vec<u8>) -> Self {
19        Self { bytes }
20    }
21}
22
23impl AsRef<[u8]> for Document {
24    #[inline]
25    fn as_ref(&self) -> &[u8] {
26        &self.bytes
27    }
28}
29
30impl Drop for Document {
31    fn drop(&mut self) {
32        self.bytes.zeroize();
33    }
34}
35
36#[derive(Copy, Clone)]
37pub(crate) enum Version {
38    V1,
39    V2,
40}