pub struct BIPrivateKey { /* private fields */ }Expand description
BI private key (.biprivatekey)
Implementations§
Source§impl BIPrivateKey
impl BIPrivateKey
Sourcepub fn read<I: Read>(input: &mut I) -> Result<BIPrivateKey, Error>
pub fn read<I: Read>(input: &mut I) -> Result<BIPrivateKey, Error>
Reads a private key from the given input.
§Errors
Returns an error if the input is not a valid private key.
Sourcepub fn generate(length: u32, name: String) -> Result<BIPrivateKey, Error>
pub fn generate(length: u32, name: String) -> Result<BIPrivateKey, Error>
Generate a new private key with the given name and bitlength, with the exponent 65537.
Arma 3 uses 1024 bit keys. The length must be a multiple of 16 (the key file layout) between 384 bits (the
CryptoAPI minimum, see BIPrivateKey::sign) and 16384 bits. Primes come from the operating system’s
random number generator.
§Errors
Returns an error if length is not usable or the keypair cannot be generated.
Sourcepub fn to_public_key(&self) -> Result<BIPublicKey, Error>
pub fn to_public_key(&self) -> Result<BIPublicKey, Error>
Returns the public key for this private key.
§Errors
Returns an error if the key material is invalid.
Sourcepub fn sign(&self, pbo: &PBO, version: BISignVersion) -> Result<BISign, Error>
pub fn sign(&self, pbo: &PBO, version: BISignVersion) -> Result<BISign, Error>
Signs the given PBO with this private key.
§Errors
Returns an error if the key is below 384 bits (the CryptoAPI minimum), the PBO’s stored SHA-1 trailer does
not match its contents (a checksum mismatch: repack the PBO first), hashing fails or the RSA operation
fails.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for BIPrivateKey
impl RefUnwindSafe for BIPrivateKey
impl Send for BIPrivateKey
impl Sync for BIPrivateKey
impl Unpin for BIPrivateKey
impl UnsafeUnpin for BIPrivateKey
impl UnwindSafe for BIPrivateKey
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> ⓘ
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> ⓘ
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