summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorAdam Vartanian <flooey@google.com>2017-03-14 14:19:10 +0000
committerAdam Vartanian <flooey@google.com>2017-03-14 15:27:34 +0000
commit652e5d1f4a7d2af60836a7930ae6c2081239c80e (patch)
treeb99528ab95fdc57365381cfbebe9a7f8bf33942e /tools
parent19285e101e0b83c9bf409136d5a08bcbd303d03a (diff)
Add autodoc support for Signature.
There are a few algorithms that used to be known by one name but now are known by another, but the first name still shows up in our documentation, so I added handling to continue to support those names. I also had to do a little bit of sleuthing on when certain algorithms appeared, because they certainly were before API 26 but our API 25 docs don't mention them. They may be slightly off in one direction or another. Bug: 35793879 Test: Ran run_update_crypto_support.sh Change-Id: Ifc3e6fa3177afd82012d75eaaf7ecb26d750659d
Diffstat (limited to 'tools')
-rw-r--r--tools/docs/crypto/data/crypto_support.json141
-rw-r--r--tools/docs/crypto/src/java/libcore/java/security/ListProviders.java20
-rwxr-xr-xtools/docs/crypto/update_crypto_support.py1
3 files changed, 161 insertions, 1 deletions
diff --git a/tools/docs/crypto/data/crypto_support.json b/tools/docs/crypto/data/crypto_support.json
index f5ee1404c0..d50eb2ccb2 100644
--- a/tools/docs/crypto/data/crypto_support.json
+++ b/tools/docs/crypto/data/crypto_support.json
@@ -676,6 +676,145 @@
{
"algorithms": [
{
+ "name": "DSA",
+ "supported_api_levels": "1+"
+ },
+ {
+ "name": "DSAWITHSHA1",
+ "supported_api_levels": "1+"
+ },
+ {
+ "deprecated": "true",
+ "name": "DSS",
+ "supported_api_levels": "1-19"
+ },
+ {
+ "name": "ECDSA",
+ "supported_api_levels": "11+"
+ },
+ {
+ "name": "ECDSAWITHSHA1",
+ "supported_api_levels": "11+"
+ },
+ {
+ "deprecated": "true",
+ "name": "MD2WITHRSA",
+ "supported_api_levels": "1-3"
+ },
+ {
+ "deprecated": "true",
+ "name": "MD4WITHRSA",
+ "supported_api_levels": "1-8"
+ },
+ {
+ "name": "MD5WITHRSA",
+ "supported_api_levels": "1+"
+ },
+ {
+ "deprecated": "true",
+ "name": "MD5WITHRSA/ISO9796-2",
+ "supported_api_levels": "1-8"
+ },
+ {
+ "name": "NONEWITHDSA",
+ "supported_api_levels": "1+"
+ },
+ {
+ "name": "NONEWITHECDSA",
+ "supported_api_levels": "11+"
+ },
+ {
+ "name": "NONEWITHRSA",
+ "supported_api_levels": "17+"
+ },
+ {
+ "deprecated": "true",
+ "name": "RSASSA-PSS",
+ "supported_api_levels": "1-8"
+ },
+ {
+ "name": "SHA1WITHDSA",
+ "supported_api_levels": "1+"
+ },
+ {
+ "name": "SHA1WITHECDSA",
+ "supported_api_levels": "11+"
+ },
+ {
+ "name": "SHA1WITHRSA",
+ "supported_api_levels": "1+"
+ },
+ {
+ "deprecated": "true",
+ "name": "SHA1WITHRSA/ISO9796-2",
+ "supported_api_levels": "1-8"
+ },
+ {
+ "name": "SHA1WITHRSA/PSS",
+ "supported_api_levels": "23+"
+ },
+ {
+ "name": "SHA224WITHDSA",
+ "supported_api_levels": "20+"
+ },
+ {
+ "name": "SHA224WITHECDSA",
+ "supported_api_levels": "20+"
+ },
+ {
+ "name": "SHA224WITHRSA",
+ "supported_api_levels": "20+"
+ },
+ {
+ "name": "SHA224WITHRSA/PSS",
+ "supported_api_levels": "23+"
+ },
+ {
+ "name": "SHA256WITHDSA",
+ "supported_api_levels": "1+"
+ },
+ {
+ "name": "SHA256WITHECDSA",
+ "supported_api_levels": "11+"
+ },
+ {
+ "name": "SHA256WITHRSA",
+ "supported_api_levels": "1+"
+ },
+ {
+ "name": "SHA256WITHRSA/PSS",
+ "supported_api_levels": "23+"
+ },
+ {
+ "name": "SHA384WITHECDSA",
+ "supported_api_levels": "11+"
+ },
+ {
+ "name": "SHA384WITHRSA",
+ "supported_api_levels": "1+"
+ },
+ {
+ "name": "SHA384WITHRSA/PSS",
+ "supported_api_levels": "23+"
+ },
+ {
+ "name": "SHA512WITHECDSA",
+ "supported_api_levels": "11+"
+ },
+ {
+ "name": "SHA512WITHRSA",
+ "supported_api_levels": "1+"
+ },
+ {
+ "name": "SHA512WITHRSA/PSS",
+ "supported_api_levels": "23+"
+ }
+ ],
+ "name": "Signature"
+ },
+ {
+ "algorithms": [
+ {
"name": "PKIX",
"supported_api_levels": "1+"
}
@@ -683,5 +822,5 @@
"name": "TrustManagerFactory"
}
],
- "last_updated": "2017-03-14 14:23:50 UTC"
+ "last_updated": "2017-03-14 15:13:50 UTC"
} \ No newline at end of file
diff --git a/tools/docs/crypto/src/java/libcore/java/security/ListProviders.java b/tools/docs/crypto/src/java/libcore/java/security/ListProviders.java
index f222e24f1c..34aed4b1aa 100644
--- a/tools/docs/crypto/src/java/libcore/java/security/ListProviders.java
+++ b/tools/docs/crypto/src/java/libcore/java/security/ListProviders.java
@@ -18,7 +18,11 @@ package libcore.java.security;
import java.security.Provider;
import java.security.Security;
+import java.util.ArrayList;
+import java.util.Arrays;
import java.util.Comparator;
+import java.util.HashSet;
+import java.util.List;
import java.util.Set;
import java.util.TreeSet;
@@ -29,6 +33,16 @@ import java.util.TreeSet;
* {@code vogar libcore/tools/src/java/libcore/java/security/ListProviders.java}
*/
public class ListProviders {
+
+ // These algorithms were previously provided, but now are aliases for a different
+ // algorithm. For documentation purposes, we want to continue having them show up
+ // as supported.
+ private static final Set<String> KNOWN_ALIASES = new HashSet<>(Arrays.asList(new String[]{
+ "Alg.Alias.Signature.DSA",
+ "Alg.Alias.Signature.DSAwithSHA1",
+ "Alg.Alias.Signature.ECDSA",
+ "Alg.Alias.Signature.ECDSAwithSHA1",
+ }));
public static void main(String[] argv) {
System.out.println("BEGIN ALGORITHM LIST");
for (Provider p : Security.getProviders()) {
@@ -46,6 +60,12 @@ public class ListProviders {
for (Provider.Service s : services) {
System.out.println(s.getType() + " " + s.getAlgorithm());
}
+ for (String alias : KNOWN_ALIASES) {
+ if (p.containsKey(alias)) {
+ String[] elements = alias.split("\\."); // Split takes a regex
+ System.out.println(elements[2] + " " + elements[3]);
+ }
+ }
}
System.out.println("END ALGORITHM LIST");
}
diff --git a/tools/docs/crypto/update_crypto_support.py b/tools/docs/crypto/update_crypto_support.py
index e3b0ba2c89..c8d19df892 100755
--- a/tools/docs/crypto/update_crypto_support.py
+++ b/tools/docs/crypto/update_crypto_support.py
@@ -47,6 +47,7 @@ SUPPORTED_CATEGORIES = [
'MessageDigest',
'SecretKeyFactory',
'SecureRandom',
+ 'Signature',
'SSLContext',
'TrustManagerFactory',
]