pub struct Keystore(/* private fields */);Expand description
An unlocked JKS or PKCS#12 keystore.
use apk::sign::Keystore;
let keystore = Keystore::open("release.keystore", "store password")?;
let identity = keystore.identity("upload", None)?;Implementations§
Source§impl Keystore
impl Keystore
Sourcepub fn open(path: impl AsRef<Path>, password: &str) -> Result<Self, Error>
pub fn open(path: impl AsRef<Path>, password: &str) -> Result<Self, Error>
Opens and unlocks the keystore at path.
Sourcepub fn from_bytes(bytes: &[u8], password: &str) -> Result<Self, KeyError>
pub fn from_bytes(bytes: &[u8], password: &str) -> Result<Self, KeyError>
Unlocks a keystore held in memory, detecting its format.
Sourcepub fn identity(
&self,
alias: &str,
key_password: Option<&str>,
) -> Result<SigningIdentity, KeyError>
pub fn identity( &self, alias: &str, key_password: Option<&str>, ) -> Result<SigningIdentity, KeyError>
The private key entry alias. JKS entries may have their own
password; it defaults to the store password. PKCS#12 entries always
use the store password.
Sourcepub fn sole_identity(
&self,
key_password: Option<&str>,
) -> Result<SigningIdentity, KeyError>
pub fn sole_identity( &self, key_password: Option<&str>, ) -> Result<SigningIdentity, KeyError>
The identity of the keystore’s only private key entry.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Keystore
impl !UnwindSafe for Keystore
impl Freeze for Keystore
impl Send for Keystore
impl Sync for Keystore
impl Unpin for Keystore
impl UnsafeUnpin for Keystore
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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