pub struct SignerWithChain<S> { /* private fields */ }Expand description
Signer decorator with an X.509 certificate chain associated with
the key pair.
Useful in contexts which require distributing the certificate chain with the
signature (e.g. the x5c JWT header parameter).
Implementations§
Source§impl<S: Signer> SignerWithChain<S>
impl<S: Signer> SignerWithChain<S>
Sourcepub fn new(signer: S, x5chain: X5Chain) -> Result<Self, CryptoError>
pub fn new(signer: S, x5chain: X5Chain) -> Result<Self, CryptoError>
Construct a new instance by pairing up a Signer with the X5Chain
for its public key.
§Errors
Returns an error if the public keys of the Signer and X5Chain’s
leaf certificate do not match.
Currently, due to limited support for signing algorithms, returns an error if the key algorithm is not supported.
Sourcepub fn certificate_chain(&self) -> &X5Chain
pub fn certificate_chain(&self) -> &X5Chain
Returns a reference to the contained X5Chain.
Sourcepub fn public_jwk(&self) -> Result<JwkPublic, CryptoError>
pub fn public_jwk(&self) -> Result<JwkPublic, CryptoError>
Get the public key in JWK format.
Trait Implementations§
Source§impl<S: Debug> Debug for SignerWithChain<S>
impl<S: Debug> Debug for SignerWithChain<S>
Source§impl<S: HasJwkKid> HasJwkKid for SignerWithChain<S>
impl<S: HasJwkKid> HasJwkKid for SignerWithChain<S>
Source§impl<S: Signer> HasX5Chain for SignerWithChain<S>
impl<S: Signer> HasX5Chain for SignerWithChain<S>
Source§impl<S: Signer> Signer for SignerWithChain<S>
impl<S: Signer> Signer for SignerWithChain<S>
Auto Trait Implementations§
impl<S> Freeze for SignerWithChain<S>where
S: Freeze,
impl<S> RefUnwindSafe for SignerWithChain<S>where
S: RefUnwindSafe,
impl<S> Send for SignerWithChain<S>where
S: Send,
impl<S> Sync for SignerWithChain<S>where
S: Sync,
impl<S> Unpin for SignerWithChain<S>where
S: Unpin,
impl<S> UnwindSafe for SignerWithChain<S>where
S: UnwindSafe,
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<S> JwtSigner for S
impl<S> JwtSigner for S
Source§fn sign_jwt<UnsignedJwt, SignedJwt>(
&self,
unsigned_jwt: UnsignedJwt,
) -> Result<SignedJwt, Box<dyn Error + Sync + Send>>where
UnsignedJwt: SignWithKey<SignedJwt>,
fn sign_jwt<UnsignedJwt, SignedJwt>(
&self,
unsigned_jwt: UnsignedJwt,
) -> Result<SignedJwt, Box<dyn Error + Sync + Send>>where
UnsignedJwt: SignWithKey<SignedJwt>,
Utility function that delegates to
jwt::SignWithKey while allowing
proper propagation of errors from both the foreign trait and the Signer.