Last active
May 13, 2019 23:15
-
-
Save akavel/bd84e99e4f887543cea9de22d3f473d9 to your computer and use it in GitHub Desktop.
Tentative apksigner crypto
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-----BEGIN CERTIFICATE----- | |
MIGgMIGVAgEBMAMGAQEwCTEHMAUGAQETADAaFwsxNzEwMTAyMjUwWhcLMTcxMDEw | |
MjI1MFowCTEHMAUGAQETADBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABLAoWrpy | |
dzdU6PN096BcSaDRFuC+/8MjLhgeFUiogqlrZFocHudWRHJALK08ge+x0n3nwCVB | |
wJ4Ybfhm0sf9nowwAwYBAQMBAA== | |
-----END CERTIFICATE----- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let | |
privKey = readFile("key.pk8").parsePKCS8PrivateKey() | |
cert = readFile("cert.x509.pem").decodePEM().parseX509Cert() | |
message = "A quick brown fox jumps over the lazy dog" | |
signature = signPKCS7Detached(message, cert, privKey) | |
if keyType(privKey) == RSAKey: | |
writeFile("signature.rsa", signature) | |
elif keyType(privKey) == ECDSAKey: | |
writeFile("signature.ec", signature) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment