diff options
| author | mo khan <mo@mokhan.ca> | 2025-07-10 13:11:11 -0600 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2025-07-10 13:11:11 -0600 |
| commit | 01959b16a21b22b5df5f16569c2a8e8f92beecef (patch) | |
| tree | 32afa5d747c5466345c59ec52161a7cba3d6d755 /vendor/rustls/src/server/common.rs | |
| parent | ff30574117a996df332e23d1fb6f65259b316b5b (diff) | |
chore: vendor dependencies
Diffstat (limited to 'vendor/rustls/src/server/common.rs')
| -rw-r--r-- | vendor/rustls/src/server/common.rs | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/vendor/rustls/src/server/common.rs b/vendor/rustls/src/server/common.rs new file mode 100644 index 00000000..8310998a --- /dev/null +++ b/vendor/rustls/src/server/common.rs @@ -0,0 +1,35 @@ +use pki_types::CertificateDer; + +use crate::sign; + +/// ActiveCertifiedKey wraps [`sign::CertifiedKey`] and tracks OSCP state in a single handshake. +pub(super) struct ActiveCertifiedKey<'a> { + key: &'a sign::CertifiedKey, + ocsp: Option<&'a [u8]>, +} + +impl ActiveCertifiedKey<'_> { + pub(super) fn from_certified_key(key: &sign::CertifiedKey) -> ActiveCertifiedKey<'_> { + ActiveCertifiedKey { + key, + ocsp: key.ocsp.as_deref(), + } + } + + /// Get the certificate chain + #[inline] + pub(super) fn get_cert(&self) -> &[CertificateDer<'static>] { + &self.key.cert + } + + /// Get the signing key + #[inline] + pub(super) fn get_key(&self) -> &dyn sign::SigningKey { + &*self.key.key + } + + #[inline] + pub(super) fn get_ocsp(&self) -> Option<&[u8]> { + self.ocsp + } +} |
