Questions tagged «digital-signature»


17
app-release-unsigned.apk未签名
我在github上下载了一个Android应用程序的zip文件,我正在尝试运行它,但是出现了一条对话框,显示以下消息 app-release-unsigned.apk is not signed. Please configure the signing information for the selected flavor using the Project Structure dialog. 我正在使用Android Studio。我应该做些什么?


9
HMAC-SHA256签名计算算法
我正在尝试使用HMAC-SHA256算法创建签名,这是我的代码。我正在使用美国ASCII编码。 final Charset asciiCs = Charset.forName("US-ASCII"); final Mac sha256_HMAC = Mac.getInstance("HmacSHA256"); final SecretKeySpec secret_key = new javax.crypto.spec.SecretKeySpec(asciiCs.encode("key").array(), "HmacSHA256"); final byte[] mac_data = sha256_HMAC.doFinal(asciiCs.encode("The quick brown fox jumps over the lazy dog").array()); String result = ""; for (final byte element : mac_data) { result += Integer.toString((element & 0xff) + 0x100, 16).substring(1); …

6
将SHA1和RSA与java.security.Signature和MessageDigest和Cipher结合使用
我试图了解Java java.security.Signature类的作用。如果我计算一个SHA1消息摘要,然后使用RSA对该摘要进行加密,则得到的结果与要求Signature类对同一事物进行签名的结果不同: // Generate new key KeyPair keyPair = KeyPairGenerator.getInstance("RSA").generateKeyPair(); PrivateKey privateKey = keyPair.getPrivate(); String plaintext = "This is the message being signed"; // Compute signature Signature instance = Signature.getInstance("SHA1withRSA"); instance.initSign(privateKey); instance.update((plaintext).getBytes()); byte[] signature = instance.sign(); // Compute digest MessageDigest sha1 = MessageDigest.getInstance("SHA1"); byte[] digest = sha1.digest((plaintext).getBytes()); // Encrypt digest …
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.