pub struct PemSigner { /* private fields */ }Expand description
The neutral signing core: one ECDSA P-256 / cosign-scheme key pair, no persistence, no
dev-key marker, no opinion about where the key came from. plecto package uses it with an
operator’s production key (field report §3.1); DevSigner wraps it with the dev-key
file conventions. Signing here is a plain function of (key, bytes) — a future KMS /
pre-computed-signature path replaces this struct at its call sites, nothing else.
Implementations§
Source§impl PemSigner
impl PemSigner
Sourcepub fn from_private_key_pem(pem: &[u8]) -> Result<PemSigner, DevKeyError>
pub fn from_private_key_pem(pem: &[u8]) -> Result<PemSigner, DevKeyError>
Load a PKCS8 PEM private key. The elliptic curve is detected from the key’s own OID (sigstore-rs), so any ECDSA key of the cosign scheme works.
Sourcepub fn sign(&self, msg: &[u8]) -> Result<Vec<u8>, DevKeyError>
pub fn sign(&self, msg: &[u8]) -> Result<Vec<u8>, DevKeyError>
Raw DER ECDSA signature over msg (the shape SignedArtifact expects).
pub fn public_key_pem(&self) -> &str
Auto Trait Implementations§
impl Freeze for PemSigner
impl RefUnwindSafe for PemSigner
impl Send for PemSigner
impl Sync for PemSigner
impl Unpin for PemSigner
impl UnsafeUnpin for PemSigner
impl UnwindSafe for PemSigner
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more