Home
last modified time | relevance | path

Searched refs:algorithm (Results 1 – 25 of 97) sorted by relevance

1234

/libcore/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/spec/
DSecretKeySpecTest.java45 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/ojluni/src/main/java/javax/crypto/spec/
DSecretKeySpec.java66 private String algorithm; field in SecretKeySpec
91 public SecretKeySpec(byte[] key, String algorithm) { in SecretKeySpec() argument
92 if (key == null || algorithm == null) { in SecretKeySpec()
99 this.algorithm = algorithm; in SecretKeySpec()
140 public SecretKeySpec(byte[] key, int offset, int len, String algorithm) { in SecretKeySpec() argument
141 if (key == null || algorithm == null) { in SecretKeySpec()
156 this.algorithm = algorithm; in SecretKeySpec()
165 return this.algorithm; in getAlgorithm()
196 if (this.algorithm.equalsIgnoreCase("TripleDES")) in hashCode()
200 this.algorithm.toLowerCase(Locale.ENGLISH).hashCode()); in hashCode()
[all …]
/libcore/ojluni/src/main/java/java/security/
DAlgorithmParameterGenerator.java124 private String algorithm; field in AlgorithmParameterGenerator
135 String algorithm) { in AlgorithmParameterGenerator() argument
138 this.algorithm = algorithm; in AlgorithmParameterGenerator()
148 return this.algorithm; in getAlgorithm()
179 public static AlgorithmParameterGenerator getInstance(String algorithm) in getInstance() argument
182 Object[] objs = Security.getImpl(algorithm, in getInstance()
188 algorithm); in getInstance()
190 throw new NoSuchAlgorithmException(algorithm + " not found"); in getInstance()
229 public static AlgorithmParameterGenerator getInstance(String algorithm, in getInstance() argument
235 Object[] objs = Security.getImpl(algorithm, in getInstance()
[all …]
DAlgorithmParameters.java173 private String algorithm; field in AlgorithmParameters
186 Provider provider, String algorithm) in AlgorithmParameters() argument
190 this.algorithm = algorithm; in AlgorithmParameters()
199 return this.algorithm; in getAlgorithm()
232 public static AlgorithmParameters getInstance(String algorithm) in getInstance() argument
235 Object[] objs = Security.getImpl(algorithm, "AlgorithmParameters", in getInstance()
239 algorithm); in getInstance()
241 throw new NoSuchAlgorithmException(algorithm + " not found"); in getInstance()
282 public static AlgorithmParameters getInstance(String algorithm, in getInstance() argument
288 Object[] objs = Security.getImpl(algorithm, "AlgorithmParameters", in getInstance()
[all …]
DKeyPairGenerator.java160 private final String algorithm; field in KeyPairGenerator
174 protected KeyPairGenerator(String algorithm) { in KeyPairGenerator() argument
175 this.algorithm = algorithm; in KeyPairGenerator()
188 return this.algorithm; in getAlgorithm()
192 String algorithm) { in getInstance() argument
198 kpg = new Delegate(spi, algorithm); in getInstance()
240 public static KeyPairGenerator getInstance(String algorithm) in getInstance() argument
243 GetInstance.getServices("KeyPairGenerator", algorithm); in getInstance()
247 (algorithm + " KeyPairGenerator not available"); in getInstance()
257 return getInstance(instance, algorithm); in getInstance()
[all …]
DKeyFactory.java125 private final String algorithm; field in KeyFactory
149 String algorithm) { in KeyFactory() argument
152 this.algorithm = algorithm; in KeyFactory()
155 private KeyFactory(String algorithm) throws NoSuchAlgorithmException { in KeyFactory() argument
156 this.algorithm = algorithm; in KeyFactory()
157 List<Service> list = GetInstance.getServices("KeyFactory", algorithm); in KeyFactory()
162 (algorithm + " KeyFactory not available"); in KeyFactory()
193 public static KeyFactory getInstance(String algorithm) in getInstance() argument
195 return new KeyFactory(algorithm); in getInstance()
232 public static KeyFactory getInstance(String algorithm, String provider) in getInstance() argument
[all …]
DMessageDigest.java145 private String algorithm; field in MessageDigest
164 protected MessageDigest(String algorithm) { in MessageDigest() argument
165 this.algorithm = algorithm; in MessageDigest()
195 public static MessageDigest getInstance(String algorithm) in getInstance() argument
199 Object[] objs = Security.getImpl(algorithm, "MessageDigest", in getInstance()
204 md = new Delegate((MessageDigestSpi)objs[0], algorithm); in getInstance()
219 throw new NoSuchAlgorithmException(algorithm + " not found"); in getInstance()
257 public static MessageDigest getInstance(String algorithm, String provider) in getInstance() argument
262 Object[] objs = Security.getImpl(algorithm, "MessageDigest", provider); in getInstance()
269 new Delegate((MessageDigestSpi)objs[0], algorithm); in getInstance()
[all …]
DSecureRandom.java133 private String algorithm; field in SecureRandom
227 this.algorithm = prng; in getDefaultPRNG()
243 String algorithm) { in SecureRandom() argument
247 this.algorithm = algorithm; in SecureRandom()
295 public static SecureRandom getInstance(String algorithm) in getInstance() argument
298 SecureRandomSpi.class, algorithm); in getInstance()
300 instance.provider, algorithm); in getInstance()
379 public static SecureRandom getInstance(String algorithm, String provider) in getInstance() argument
383 SecureRandomSpi.class, algorithm, provider); in getInstance()
385 instance.provider, algorithm); in getInstance()
[all …]
DKeyRep.java96 private String algorithm; field in KeyRep
131 public KeyRep(Type type, String algorithm, in KeyRep() argument
134 if (type == null || algorithm == null || in KeyRep()
140 this.algorithm = algorithm; in KeyRep()
172 return new SecretKeySpec(encoded, algorithm); in readResolve()
174 KeyFactory f = KeyFactory.getInstance(algorithm); in readResolve()
177 KeyFactory f = KeyFactory.getInstance(algorithm); in readResolve()
190 "[" + algorithm + "] " + in readResolve()
/libcore/ojluni/src/main/java/javax/net/ssl/
DTrustManagerFactory.java66 private String algorithm; field in TrustManagerFactory
103 Provider provider, String algorithm) { in TrustManagerFactory() argument
106 this.algorithm = algorithm; in TrustManagerFactory()
121 return this.algorithm; in getAlgorithm()
152 public static final TrustManagerFactory getInstance(String algorithm) in getInstance() argument
156 algorithm); in getInstance()
158 instance.provider, algorithm); in getInstance()
195 public static final TrustManagerFactory getInstance(String algorithm, in getInstance() argument
200 algorithm, provider); in getInstance()
202 instance.provider, algorithm); in getInstance()
[all …]
DKeyManagerFactory.java66 private String algorithm; field in KeyManagerFactory
103 Provider provider, String algorithm) { in KeyManagerFactory() argument
106 this.algorithm = algorithm; in KeyManagerFactory()
119 return this.algorithm; in getAlgorithm()
150 public static final KeyManagerFactory getInstance(String algorithm) in getInstance() argument
154 algorithm); in getInstance()
156 instance.provider, algorithm); in getInstance()
193 public static final KeyManagerFactory getInstance(String algorithm, in getInstance() argument
198 algorithm, provider); in getInstance()
200 instance.provider, algorithm); in getInstance()
[all …]
/libcore/ojluni/src/main/java/sun/security/jca/
DGetInstance.java64 public static Service getService(String type, String algorithm) in getService() argument
67 Service s = list.getService(type, algorithm); in getService()
70 (algorithm + " " + type + " not available"); in getService()
75 public static Service getService(String type, String algorithm, in getService() argument
85 Service s = p.getService(type, algorithm); in getService()
88 + algorithm + " for provider " + provider); in getService()
93 public static Service getService(String type, String algorithm, in getService() argument
98 Service s = provider.getService(type, algorithm); in getService()
101 + algorithm + " for provider " + provider.getName()); in getService()
112 public static List<Service> getServices(String type, String algorithm) { in getServices() argument
[all …]
/libcore/ojluni/src/main/java/java/security/cert/
DCertPathBuilder.java125 private final String algorithm; field in CertPathBuilder
136 String algorithm) in CertPathBuilder() argument
140 this.algorithm = algorithm; in CertPathBuilder()
171 public static CertPathBuilder getInstance(String algorithm) in getInstance() argument
174 CertPathBuilderSpi.class, algorithm); in getInstance()
176 instance.provider, algorithm); in getInstance()
214 public static CertPathBuilder getInstance(String algorithm, String provider) in getInstance() argument
217 CertPathBuilderSpi.class, algorithm, provider); in getInstance()
219 instance.provider, algorithm); in getInstance()
251 public static CertPathBuilder getInstance(String algorithm, in getInstance() argument
[all …]
DCertPathValidator.java124 private final String algorithm; field in CertPathValidator
135 Provider provider, String algorithm) in CertPathValidator() argument
139 this.algorithm = algorithm; in CertPathValidator()
170 public static CertPathValidator getInstance(String algorithm) in getInstance() argument
173 CertPathValidatorSpi.class, algorithm); in getInstance()
175 instance.provider, algorithm); in getInstance()
213 public static CertPathValidator getInstance(String algorithm, in getInstance() argument
217 CertPathValidatorSpi.class, algorithm, provider); in getInstance()
219 instance.provider, algorithm); in getInstance()
251 public static CertPathValidator getInstance(String algorithm, in getInstance() argument
[all …]
/libcore/luni/src/test/java/libcore/javax/crypto/
DKeyGeneratorTest.java56 String algorithm = service.getAlgorithm(); in test_getInstance() local
59 KeyGenerator kg1 = KeyGenerator.getInstance(algorithm); in test_getInstance()
60 assertEquals(algorithm, kg1.getAlgorithm()); in test_getInstance()
64 KeyGenerator kg2 = KeyGenerator.getInstance(algorithm, provider); in test_getInstance()
65 assertEquals(algorithm, kg2.getAlgorithm()); in test_getInstance()
70 KeyGenerator kg3 = KeyGenerator.getInstance(algorithm, provider.getName()); in test_getInstance()
71 assertEquals(algorithm, kg3.getAlgorithm()); in test_getInstance()
75 throw new Exception("Problem testing KeyPairGenerator." + algorithm, e); in test_getInstance()
83 private static void putKeySize(String algorithm, int keySize) { in putKeySize() argument
84 algorithm = algorithm.toUpperCase(); in putKeySize()
[all …]
/libcore/luni/src/main/java/org/apache/harmony/security/
DPrivateKeyImpl.java33 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()
DPublicKeyImpl.java37 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()
/libcore/ojluni/src/main/java/javax/crypto/
DSecretKeyFactory.java273 private final String algorithm; field in SecretKeyFactory
293 Provider provider, String algorithm) { in SecretKeyFactory() argument
296 this.algorithm = algorithm; in SecretKeyFactory()
299 private SecretKeyFactory(String algorithm) throws NoSuchAlgorithmException { in SecretKeyFactory() argument
300 this.algorithm = algorithm; in SecretKeyFactory()
302 GetInstance.getServices("SecretKeyFactory", algorithm); in SecretKeyFactory()
307 (algorithm + " SecretKeyFactory not available"); in SecretKeyFactory()
342 public static final SecretKeyFactory getInstance(String algorithm) in getInstance() argument
344 return new SecretKeyFactory(algorithm); in getInstance()
385 public static final SecretKeyFactory getInstance(String algorithm, in getInstance() argument
[all …]
DKeyAgreement.java108 private final String algorithm; field in KeyAgreement
120 String algorithm) { in KeyAgreement() argument
123 this.algorithm = algorithm; in KeyAgreement()
127 private KeyAgreement(String algorithm) { in KeyAgreement() argument
128 this.algorithm = algorithm; in KeyAgreement()
142 return this.algorithm; in getAlgorithm()
176 public static final KeyAgreement getInstance(String algorithm) in getInstance() argument
179 GetInstance.getServices("KeyAgreement", algorithm); in getInstance()
187 return new KeyAgreement(algorithm); in getInstance()
190 ("Algorithm " + algorithm + " not available"); in getInstance()
[all …]
DMac.java173 private final String algorithm; field in Mac
187 protected Mac(MacSpi macSpi, Provider provider, String algorithm) { in Mac() argument
190 this.algorithm = algorithm; in Mac()
194 private Mac(String algorithm) { in Mac() argument
195 this.algorithm = algorithm; in Mac()
209 return this.algorithm; in getAlgorithm()
239 public static final Mac getInstance(String algorithm) in getInstance() argument
241 List<Service> services = GetInstance.getServices("Mac", algorithm); in getInstance()
249 return new Mac(algorithm); in getInstance()
252 ("Algorithm " + algorithm + " not available"); in getInstance()
[all …]
DKeyGenerator.java191 private final String algorithm; field in KeyGenerator
210 String algorithm) { in KeyGenerator() argument
213 this.algorithm = algorithm; in KeyGenerator()
223 private KeyGenerator(String algorithm) throws NoSuchAlgorithmException { in KeyGenerator() argument
224 this.algorithm = algorithm; in KeyGenerator()
226 GetInstance.getServices("KeyGenerator", algorithm); in KeyGenerator()
232 (algorithm + " KeyGenerator not available"); in KeyGenerator()
253 return this.algorithm; in getAlgorithm()
285 public static final KeyGenerator getInstance(String algorithm) in getInstance() argument
287 return new KeyGenerator(algorithm); in getInstance()
[all …]
/libcore/ojluni/src/main/java/sun/security/util/
DDisabledAlgorithmConstraints.java97 String algorithm, AlgorithmParameters parameters) { in permits() argument
103 return checkAlgorithm(disabledAlgorithms, algorithm, decomposer); in permits()
121 String algorithm, Key key, AlgorithmParameters parameters) { in permits() argument
123 if (algorithm == null || algorithm.length() == 0) { in permits()
127 return checkConstraints(primitives, algorithm, key, parameters); in permits()
164 String algorithm, Key key, AlgorithmParameters parameters) { in checkConstraints() argument
172 if (algorithm != null && algorithm.length() != 0) { in checkConstraints()
173 if (!permits(primitives, algorithm, parameters)) { in checkConstraints()
195 String algorithm = cert.getSigAlgName(); in checkConstraints() local
198 if (!permits(primitives, algorithm, null)) { in checkConstraints()
[all …]
DAlgorithmDecomposer.java41 private static Set<String> decomposeImpl(String algorithm) { in decomposeImpl() argument
44 String[] transTockens = transPattern.split(algorithm); in decomposeImpl()
79 public Set<String> decompose(String algorithm) { in decompose() argument
80 if (algorithm == null || algorithm.length() == 0) { in decompose()
84 Set<String> elements = decomposeImpl(algorithm); in decompose()
149 public static Set<String> decomposeOneHash(String algorithm) { in decomposeOneHash() argument
150 if (algorithm == null || algorithm.length() == 0) { in decomposeOneHash()
154 Set<String> elements = decomposeImpl(algorithm); in decomposeOneHash()
169 public static String hashName(String algorithm) { in hashName() argument
170 return algorithm.replace("-", ""); in hashName()
/libcore/luni/src/test/java/libcore/java/security/
DMessageDigestTest.java63 String algorithm = service.getAlgorithm(); in test_getInstance() local
66 MessageDigest md1 = MessageDigest.getInstance(algorithm); in test_getInstance()
67 assertEquals(algorithm, md1.getAlgorithm()); in test_getInstance()
71 MessageDigest md2 = MessageDigest.getInstance(algorithm, provider); in test_getInstance()
72 assertEquals(algorithm, md2.getAlgorithm()); in test_getInstance()
77 MessageDigest md3 = MessageDigest.getInstance(algorithm, provider.getName()); in test_getInstance()
78 assertEquals(algorithm, md3.getAlgorithm()); in test_getInstance()
82 throw new Exception("Problem testing MessageDigest." + algorithm, e); in test_getInstance()
90 private static void putExpectation(String algorithm, String inputName, byte[] expected) { in putExpectation() argument
91 algorithm = algorithm.toUpperCase(); in putExpectation()
[all …]
/libcore/luni/src/test/java/org/apache/harmony/security/tests/java/security/
DMessageDigest2Test.java67 for (String algorithm : algorithms) { in test_constructor()
68 MessageDigestStub md = new MessageDigestStub(algorithm); in test_constructor()
69 assertEquals(algorithm, md.getAlgorithm()); in test_constructor()
81 for (String algorithm : e.getValue()) { in test_clone()
82 MessageDigest d1 = MessageDigest.getInstance(algorithm, e.getKey().getName()); in test_clone()
91 assertTrue("cloned hash differs from original for algorithm " + algorithm, in test_clone()
243 for (String algorithm : e.getValue()) { in test_digest$B()
244 MessageDigest digest = MessageDigest.getInstance(algorithm, e.getKey().getName()); in test_digest$B()
256 for (String algorithm : e.getValue()) { in test_digest$BII()
257 MessageDigest digest = MessageDigest.getInstance(algorithm, e.getKey().getName()); in test_digest$BII()
[all …]

1234