/libcore/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/spec/ |
D | SecretKeySpecTest.java | 45 String algorithm = "Algorithm"; in testSecretKeySpec1() local 48 new SecretKeySpec(new byte[] {}, algorithm); in testSecretKeySpec1() 55 new SecretKeySpec(null, algorithm); in testSecretKeySpec1() 68 SecretKeySpec ks = new SecretKeySpec(key, algorithm); in testSecretKeySpec1() 85 String algorithm = "Algorithm"; in testSecretKeySpec2() local 88 new SecretKeySpec(new byte[] {}, 0, 0, algorithm); in testSecretKeySpec2() 95 new SecretKeySpec(null, 0, 0, algorithm); in testSecretKeySpec2() 109 new SecretKeySpec(key, offset, key.length, algorithm); in testSecretKeySpec2() 116 new SecretKeySpec(key, 0, -1, algorithm); in testSecretKeySpec2() 124 SecretKeySpec ks = new SecretKeySpec(key, algorithm); in testSecretKeySpec2() [all …]
|
/libcore/luni/src/main/java/javax/net/ssl/ |
D | TrustManagerFactory.java | 54 String algorithm = Security.getProperty(PROPERTY_NAME); in getDefaultAlgorithm() local 55 return (algorithm != null ? algorithm : DEFAULT_PROPERTY); in getDefaultAlgorithm() 71 public static final TrustManagerFactory getInstance(String algorithm) in getInstance() argument 73 if (algorithm == null) { in getInstance() 76 Engine.SpiAndProvider sap = ENGINE.getInstance(algorithm, null); in getInstance() 77 return new TrustManagerFactory((TrustManagerFactorySpi) sap.spi, sap.provider, algorithm); in getInstance() 99 public static final TrustManagerFactory getInstance(String algorithm, String provider) in getInstance() argument 108 return getInstance(algorithm, impProvider); in getInstance() 127 public static final TrustManagerFactory getInstance(String algorithm, Provider provider) in getInstance() argument 132 if (algorithm == null) { in getInstance() [all …]
|
D | KeyManagerFactory.java | 55 String algorithm = Security.getProperty(PROPERTY_NAME); in getDefaultAlgorithm() local 56 return (algorithm != null ? algorithm : DEFAULT_PROPERTY); in getDefaultAlgorithm() 72 public static final KeyManagerFactory getInstance(String algorithm) in getInstance() argument 74 if (algorithm == null) { in getInstance() 77 Engine.SpiAndProvider sap = ENGINE.getInstance(algorithm, null); in getInstance() 78 return new KeyManagerFactory((KeyManagerFactorySpi) sap.spi, sap.provider, algorithm); in getInstance() 100 public static final KeyManagerFactory getInstance(String algorithm, String provider) in getInstance() argument 109 return getInstance(algorithm, impProvider); in getInstance() 128 public static final KeyManagerFactory getInstance(String algorithm, Provider provider) in getInstance() argument 133 if (algorithm == null) { in getInstance() [all …]
|
/libcore/luni/src/main/java/java/security/ |
D | KeyPairGenerator.java | 46 private String algorithm; field in KeyPairGenerator 55 protected KeyPairGenerator(String algorithm) { in KeyPairGenerator() argument 56 this.algorithm = algorithm; in KeyPairGenerator() 65 return algorithm; in getAlgorithm() 80 public static KeyPairGenerator getInstance(String algorithm) in getInstance() argument 82 if (algorithm == null) { in getInstance() 85 Engine.SpiAndProvider sap = ENGINE.getInstance(algorithm, null); in getInstance() 90 result.algorithm = algorithm; in getInstance() 94 return new KeyPairGeneratorImpl((KeyPairGeneratorSpi) spi, provider, algorithm); in getInstance() 113 public static KeyPairGenerator getInstance(String algorithm, String provider) in getInstance() argument [all …]
|
D | AlgorithmParameterGenerator.java | 45 private final String algorithm; field in AlgorithmParameterGenerator 60 String algorithm) { in AlgorithmParameterGenerator() argument 62 this.algorithm = algorithm; in AlgorithmParameterGenerator() 72 return algorithm; in getAlgorithm() 88 public static AlgorithmParameterGenerator getInstance(String algorithm) in getInstance() argument 90 if (algorithm == null) { in getInstance() 93 Engine.SpiAndProvider sap = ENGINE.getInstance(algorithm, null); in getInstance() 95 sap.provider, algorithm); in getInstance() 117 public static AlgorithmParameterGenerator getInstance(String algorithm, in getInstance() argument 127 return getInstance(algorithm, impProvider); in getInstance() [all …]
|
D | KeyFactory.java | 44 private final String algorithm; field in KeyFactory 59 String algorithm) { in KeyFactory() argument 61 this.algorithm = algorithm; in KeyFactory() 76 public static KeyFactory getInstance(String algorithm) in getInstance() argument 78 if (algorithm == null) { in getInstance() 81 Engine.SpiAndProvider sap = ENGINE.getInstance(algorithm, null); in getInstance() 82 return new KeyFactory((KeyFactorySpi) sap.spi, sap.provider, algorithm); in getInstance() 101 public static KeyFactory getInstance(String algorithm, String provider) in getInstance() argument 110 return getInstance(algorithm, p); in getInstance() 128 public static KeyFactory getInstance(String algorithm, Provider provider) in getInstance() argument [all …]
|
D | MessageDigest.java | 60 private String algorithm; field in MessageDigest 69 protected MessageDigest(String algorithm) { in MessageDigest() argument 70 this.algorithm = algorithm; in MessageDigest() 86 public static MessageDigest getInstance(String algorithm) in getInstance() argument 88 if (algorithm == null) { in getInstance() 91 Engine.SpiAndProvider sap = ENGINE.getInstance(algorithm, null); in getInstance() 96 result.algorithm = algorithm; in getInstance() 100 return new MessageDigestImpl((MessageDigestSpi) sap.spi, sap.provider, algorithm); in getInstance() 121 public static MessageDigest getInstance(String algorithm, String provider) in getInstance() argument 130 return getInstance(algorithm, p); in getInstance() [all …]
|
D | AlgorithmParameters.java | 54 private final String algorithm; field in AlgorithmParameters 73 Provider provider, String algorithm) { in AlgorithmParameters() argument 75 this.algorithm = algorithm; in AlgorithmParameters() 92 public static AlgorithmParameters getInstance(String algorithm) in getInstance() argument 94 if (algorithm == null) { in getInstance() 97 Engine.SpiAndProvider sap = ENGINE.getInstance(algorithm, null); in getInstance() 98 return new AlgorithmParameters((AlgorithmParametersSpi) sap.spi, sap.provider, algorithm); in getInstance() 119 public static AlgorithmParameters getInstance(String algorithm, in getInstance() argument 129 return getInstance(algorithm, p); in getInstance() 149 public static AlgorithmParameters getInstance(String algorithm, in getInstance() argument [all …]
|
D | SecureRandom.java | 79 private final String algorithm; field in SecureRandom 93 this.algorithm = "SHA1PRNG"; in SecureRandom() 98 this.algorithm = service.getAlgorithm(); in SecureRandom() 132 String algorithm) { in SecureRandom() argument 135 this.algorithm = algorithm; in SecureRandom() 152 public static SecureRandom getInstance(String algorithm) throws NoSuchAlgorithmException { in getInstance() argument 153 if (algorithm == null) { in getInstance() 156 Engine.SpiAndProvider sap = ENGINE.getInstance(algorithm, null); in getInstance() 158 algorithm); in getInstance() 179 public static SecureRandom getInstance(String algorithm, String provider) in getInstance() argument [all …]
|
D | Signature.java | 49 final String algorithm; field in Signature 83 protected Signature(String algorithm) { in Signature() argument 84 this.algorithm = algorithm; in Signature() 100 public static Signature getInstance(String algorithm) in getInstance() argument 102 if (algorithm == null) { in getInstance() 105 return getSignature(algorithm, null); in getInstance() 126 public static Signature getInstance(String algorithm, String provider) in getInstance() argument 128 if (algorithm == null) { in getInstance() 138 return getSignature(algorithm, p); in getInstance() 158 public static Signature getInstance(String algorithm, Provider provider) in getInstance() argument [all …]
|
/libcore/luni/src/main/java/org/apache/harmony/security/fortress/ |
D | Engine.java | 94 private final String algorithm; field in Engine.ServiceCacheEntry 100 private ServiceCacheEntry(String algorithm, in ServiceCacheEntry() argument 103 this.algorithm = algorithm; in ServiceCacheEntry() 132 public SpiAndProvider getInstance(String algorithm, Object param) in getInstance() argument 134 if (algorithm == null) { in getInstance() 137 ArrayList<Provider.Service> services = getServices(algorithm); in getInstance() 139 throw notFound(this.serviceName, algorithm); in getInstance() 157 public ArrayList<Provider.Service> getServices(String algorithm) { in getServices() argument 160 final String algoUC = algorithm.toUpperCase(Locale.US); in getServices() 162 && cacheEntry.algorithm.equalsIgnoreCase(algoUC) in getServices() [all …]
|
/libcore/luni/src/main/java/java/security/cert/ |
D | CertPathValidator.java | 53 private final String algorithm; field in CertPathValidator 66 Provider provider, String algorithm) { in CertPathValidator() argument 68 this.algorithm = algorithm; in CertPathValidator() 78 return algorithm; in getAlgorithm() 101 public static CertPathValidator getInstance(String algorithm) in getInstance() argument 103 if (algorithm == null) { in getInstance() 106 Engine.SpiAndProvider sap = ENGINE.getInstance(algorithm, null); in getInstance() 107 return new CertPathValidator((CertPathValidatorSpi) sap.spi, sap.provider, algorithm); in getInstance() 128 public static CertPathValidator getInstance(String algorithm, in getInstance() argument 138 return getInstance(algorithm, impProvider); in getInstance() [all …]
|
D | CertPathBuilder.java | 52 private final String algorithm; field in CertPathBuilder 65 String algorithm) { in CertPathBuilder() argument 67 this.algorithm = algorithm; in CertPathBuilder() 77 return algorithm; in getAlgorithm() 101 public static CertPathBuilder getInstance(String algorithm) in getInstance() argument 103 if (algorithm == null) { in getInstance() 106 Engine.SpiAndProvider sap = ENGINE.getInstance(algorithm, null); in getInstance() 107 return new CertPathBuilder((CertPathBuilderSpi) sap.spi, sap.provider, algorithm); in getInstance() 127 public static CertPathBuilder getInstance(String algorithm, String provider) in getInstance() argument 136 return getInstance(algorithm, impProvider); in getInstance() [all …]
|
/libcore/luni/src/main/java/javax/crypto/ |
D | SecretKeyFactory.java | 54 private final String algorithm; field in SecretKeyFactory 67 Provider provider, String algorithm) { in SecretKeyFactory() argument 69 this.algorithm = algorithm; in SecretKeyFactory() 79 return algorithm; in getAlgorithm() 103 public static final SecretKeyFactory getInstance(String algorithm) in getInstance() argument 105 if (algorithm == null) { in getInstance() 108 Engine.SpiAndProvider sap = ENGINE.getInstance(algorithm, null); in getInstance() 109 return new SecretKeyFactory((SecretKeyFactorySpi) sap.spi, sap.provider, algorithm); in getInstance() 131 public static final SecretKeyFactory getInstance(String algorithm, in getInstance() argument 141 return getInstance(algorithm, impProvider); in getInstance() [all …]
|
D | KeyGenerator.java | 49 private final String algorithm; field in KeyGenerator 62 String algorithm) { in KeyGenerator() argument 64 this.algorithm = algorithm; in KeyGenerator() 74 return algorithm; in getAlgorithm() 98 public static final KeyGenerator getInstance(String algorithm) in getInstance() argument 100 if (algorithm == null) { in getInstance() 103 Engine.SpiAndProvider sap = ENGINE.getInstance(algorithm, null); in getInstance() 104 return new KeyGenerator((KeyGeneratorSpi) sap.spi, sap.provider, algorithm); in getInstance() 126 public static final KeyGenerator getInstance(String algorithm, in getInstance() argument 135 return getInstance(algorithm, impProvider); in getInstance() [all …]
|
D | KeyAgreement.java | 59 private final String algorithm; field in KeyAgreement 77 String algorithm) { in KeyAgreement() argument 80 this.algorithm = algorithm; in KeyAgreement() 89 return algorithm; in getAlgorithm() 113 public static final KeyAgreement getInstance(String algorithm) throws NoSuchAlgorithmException { in getInstance() argument 114 return getKeyAgreement(algorithm, null); in getInstance() 136 public static final KeyAgreement getInstance(String algorithm, String provider) in getInstance() argument 145 return getKeyAgreement(algorithm, impProvider); in getInstance() 167 public static final KeyAgreement getInstance(String algorithm, Provider provider) in getInstance() argument 172 return getKeyAgreement(algorithm, provider); in getInstance() [all …]
|
D | Mac.java | 56 private final String algorithm; field in Mac 76 protected Mac(MacSpi macSpi, Provider provider, String algorithm) { in Mac() argument 78 this.algorithm = algorithm; in Mac() 89 return algorithm; in getAlgorithm() 115 public static final Mac getInstance(String algorithm) in getInstance() argument 117 return getMac(algorithm, null); in getInstance() 140 public static final Mac getInstance(String algorithm, String provider) in getInstance() argument 149 return getMac(algorithm, impProvider); in getInstance() 171 public static final Mac getInstance(String algorithm, Provider provider) in getInstance() argument 176 return getMac(algorithm, provider); in getInstance() [all …]
|
/libcore/luni/src/main/java/javax/crypto/spec/ |
D | SecretKeySpec.java | 43 private final String algorithm; field in SecretKeySpec 57 public SecretKeySpec(byte[] key, String algorithm) { in SecretKeySpec() argument 64 if (algorithm == null) { in SecretKeySpec() 68 this.algorithm = algorithm; in SecretKeySpec() 93 public SecretKeySpec(byte[] key, int offset, int len, String algorithm) { in SecretKeySpec() argument 106 if (algorithm == null) { in SecretKeySpec() 109 this.algorithm = algorithm; in SecretKeySpec() 120 return algorithm; in getAlgorithm() 150 int result = algorithm.length(); in hashCode() 175 return (algorithm.equalsIgnoreCase(ks.algorithm)) in equals()
|
/libcore/luni/src/main/java/org/apache/harmony/security/x509/ |
D | AlgorithmIdentifier.java | 52 private String algorithm; field in AlgorithmIdentifier 60 public AlgorithmIdentifier(String algorithm) { in AlgorithmIdentifier() argument 61 this(algorithm, null, null); in AlgorithmIdentifier() 64 public AlgorithmIdentifier(String algorithm, byte[] parameters) { in AlgorithmIdentifier() argument 65 this(algorithm, parameters, null); in AlgorithmIdentifier() 68 private AlgorithmIdentifier(String algorithm, byte[] parameters, byte[] encoding) { in AlgorithmIdentifier() argument 69 this.algorithm = algorithm; in AlgorithmIdentifier() 77 public AlgorithmIdentifier(String algorithm, String algorithmName) { in AlgorithmIdentifier() argument 78 this(algorithm, null, null); in AlgorithmIdentifier() 86 return algorithm; in getAlgorithm() [all …]
|
D | X509PublicKey.java | 23 private final String algorithm; field in X509PublicKey 27 public X509PublicKey(String algorithm, byte[] encoded, byte[] keyBytes) { in X509PublicKey() argument 28 this.algorithm = algorithm; in X509PublicKey() 34 return algorithm; in getAlgorithm() 48 buf.append(algorithm); in toString()
|
/libcore/luni/src/main/java/org/apache/harmony/security/ |
D | PublicKeyImpl.java | 37 private String algorithm; field in PublicKeyImpl 40 public PublicKeyImpl(String algorithm) { in PublicKeyImpl() argument 41 this.algorithm = algorithm; in PublicKeyImpl() 46 return algorithm; in getAlgorithm() 62 public void setAlgorithm(String algorithm) { in setAlgorithm() argument 63 this.algorithm = algorithm; in setAlgorithm()
|
D | PrivateKeyImpl.java | 33 private String algorithm; field in PrivateKeyImpl 37 public PrivateKeyImpl(String algorithm) { in PrivateKeyImpl() argument 38 this.algorithm = algorithm; in PrivateKeyImpl() 42 return algorithm; in getAlgorithm() 57 public void setAlgorithm(String algorithm) { in setAlgorithm() argument 58 this.algorithm = algorithm; in setAlgorithm()
|
/libcore/luni/src/test/java/libcore/javax/crypto/ |
D | KeyGeneratorTest.java | 47 String algorithm = service.getAlgorithm(); in test_getInstance() local 50 KeyGenerator kg1 = KeyGenerator.getInstance(algorithm); in test_getInstance() 51 assertEquals(algorithm, kg1.getAlgorithm()); in test_getInstance() 55 KeyGenerator kg2 = KeyGenerator.getInstance(algorithm, provider); in test_getInstance() 56 assertEquals(algorithm, kg2.getAlgorithm()); in test_getInstance() 61 KeyGenerator kg3 = KeyGenerator.getInstance(algorithm, provider.getName()); in test_getInstance() 62 assertEquals(algorithm, kg3.getAlgorithm()); in test_getInstance() 66 throw new Exception("Problem testing KeyPairGenerator." + algorithm, e); in test_getInstance() 74 private static void putKeySize(String algorithm, int keySize) { in putKeySize() argument 75 algorithm = algorithm.toUpperCase(); in putKeySize() [all …]
|
D | CipherTest.java | 77 private static boolean isSupported(String algorithm, String provider) { in isSupported() argument 78 if (algorithm.equals("RC2")) { in isSupported() 81 if (algorithm.equals("PBEWITHMD5ANDRC2")) { in isSupported() 84 if (algorithm.startsWith("PBEWITHSHA1ANDRC2")) { in isSupported() 87 if (algorithm.equals("PBEWITHSHAAND40BITRC2-CBC")) { in isSupported() 90 if (algorithm.equals("PBEWITHSHAAND128BITRC2-CBC")) { in isSupported() 93 if (algorithm.equals("PBEWITHSHAANDTWOFISH-CBC")) { in isSupported() 97 if (algorithm.equals("PBEWITHMD5ANDTRIPLEDES")) { in isSupported() 103 (algorithm.equals("AES/CFB/PKCS5PADDING") in isSupported() 104 || algorithm.equals("AES/CFB/PKCS7PADDING") in isSupported() [all …]
|
/libcore/luni/src/test/java/libcore/java/security/ |
D | MessageDigestTest.java | 58 String algorithm = service.getAlgorithm(); in test_getInstance() local 61 MessageDigest md1 = MessageDigest.getInstance(algorithm); in test_getInstance() 62 assertEquals(algorithm, md1.getAlgorithm()); in test_getInstance() 66 MessageDigest md2 = MessageDigest.getInstance(algorithm, provider); in test_getInstance() 67 assertEquals(algorithm, md2.getAlgorithm()); in test_getInstance() 72 MessageDigest md3 = MessageDigest.getInstance(algorithm, provider.getName()); in test_getInstance() 73 assertEquals(algorithm, md3.getAlgorithm()); in test_getInstance() 77 throw new Exception("Problem testing MessageDigest." + algorithm, e); in test_getInstance() 85 private static void putExpectation(String algorithm, String inputName, byte[] expected) { in putExpectation() argument 86 algorithm = algorithm.toUpperCase(); in putExpectation() [all …]
|