new helpers for drive decryption (#73)
* new helpers for drive decryption * modular helper functions and reciprocals * removed duplicates helper functions * added mobile wrapper * unit tests for new helpers Co-authored-by: wussler <aron@wussler.it>
This commit is contained in:
parent
af371097e0
commit
39c2fa863e
3 changed files with 231 additions and 38 deletions
|
|
@ -79,3 +79,20 @@ func GetJsonSHA256Fingerprints(publicKey string) ([]byte, error) {
|
|||
|
||||
return json.Marshal(key.GetSHA256Fingerprints())
|
||||
}
|
||||
|
||||
type EncryptSignArmoredDetachedMobileResult struct {
|
||||
Ciphertext, Signature string
|
||||
}
|
||||
|
||||
//EncryptSignArmoredDetachedMobile wraps the EncryptSignArmoredDetached method
|
||||
//to have only one return argument for mobile.
|
||||
func EncryptSignArmoredDetachedMobile(
|
||||
publicKey, privateKey string,
|
||||
passphrase, plainData []byte,
|
||||
) (wrappedTuple *EncryptSignArmoredDetachedMobileResult, err error) {
|
||||
ciphertext, signature, err := EncryptSignArmoredDetached(publicKey, privateKey, passphrase, plainData)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &EncryptSignArmoredDetachedMobileResult{ciphertext, signature}, nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue