/external/bouncycastle/bcprov/src/main/java/org/bouncycastle/jcajce/provider/asymmetric/x509/ |
KeyFactory.java | 9 import java.security.spec.KeySpec; 22 KeySpec keySpec) 25 if (keySpec instanceof PKCS8EncodedKeySpec) 29 PrivateKeyInfo info = PrivateKeyInfo.getInstance(((PKCS8EncodedKeySpec)keySpec).getEncoded()); 45 throw new InvalidKeySpecException("Unknown KeySpec type: " + keySpec.getClass().getName()); 49 KeySpec keySpec) 52 if (keySpec instanceof X509EncodedKeySpec [all...] |
/libcore/luni/src/main/java/java/security/ |
KeyFactorySpi.java | 21 import java.security.spec.KeySpec; 35 * @param keySpec 39 * if the specified {@code keySpec} is invalid. 41 protected abstract PublicKey engineGeneratePublic(KeySpec keySpec) 48 * @param keySpec 52 * if the specified {@code keySpec} is invalid. 54 protected abstract PrivateKey engineGeneratePrivate(KeySpec keySpec) 62 * @param keySpec [all...] |
KeyFactory.java | 21 import java.security.spec.KeySpec; 163 * @param keySpec 167 * if the specified {@code keySpec} is invalid 169 public final PublicKey generatePublic(KeySpec keySpec) 171 return spiImpl.engineGeneratePublic(keySpec); 178 * @param keySpec 182 * if the specified {@code keySpec} is invalid. 184 public final PrivateKey generatePrivate(KeySpec keySpec) [all...] |
/libcore/luni/src/main/java/org/apache/harmony/security/provider/crypto/ |
DSAKeyFactoryImpl.java | 32 import java.security.spec.KeySpec; 42 * keySpec - the specification (key material) for the DSAPrivateKey. 48 * if "keySpec" is neither DSAPrivateKeySpec nor PKCS8EncodedKeySpec 50 protected PrivateKey engineGeneratePrivate(KeySpec keySpec) 53 if (keySpec != null) { 54 if (keySpec instanceof DSAPrivateKeySpec) { 56 return new DSAPrivateKeyImpl((DSAPrivateKeySpec) keySpec); 58 if (keySpec instanceof PKCS8EncodedKeySpec) { 60 return new DSAPrivateKeyImpl((PKCS8EncodedKeySpec) keySpec); [all...] |
DSAPrivateKeyImpl.java | 23 * in the below "DSAPrivateKeyImpl(PKCS8EncodedKeySpec keySpec)" constructor. 62 * @param keySpec - a DSAPrivateKeySpec object 64 public DSAPrivateKeyImpl(DSAPrivateKeySpec keySpec) { 70 g = keySpec.getG(); 71 p = keySpec.getP(); 72 q = keySpec.getQ(); 80 x = keySpec.getX(); 93 * @param keySpec - a XPKCS8EncodedKeySpec object 97 public DSAPrivateKeyImpl(PKCS8EncodedKeySpec keySpec) 107 byte[] encoding = keySpec.getEncoded() [all...] |
/external/bouncycastle/bcprov/src/main/java/org/bouncycastle/jcajce/provider/symmetric/util/ |
BaseSecretKeyFactory.java | 6 import java.security.spec.KeySpec; 30 KeySpec keySpec) 33 if (keySpec instanceof SecretKeySpec) 35 return (SecretKey)keySpec; 38 throw new InvalidKeySpecException("Invalid KeySpec"); 41 protected KeySpec engineGetKeySpec( 43 Class keySpec) 46 if (keySpec == null) 48 throw new InvalidKeySpecException("keySpec parameter is null") [all...] |
PBE.java | 241 PBEKeySpec keySpec, 251 key = convertPassword(type, keySpec); 253 generator.init(key, keySpec.getSalt(), keySpec.getIterationCount()); 279 PBEKeySpec keySpec, 288 key = convertPassword(type, keySpec); 290 generator.init(key, keySpec.getSalt(), keySpec.getIterationCount()); 302 private static byte[] convertPassword(int type, PBEKeySpec keySpec) 308 key = PBEParametersGenerator.PKCS12PasswordToBytes(keySpec.getPassword()) [all...] |
PBESecretKeyFactory.java | 4 import java.security.spec.KeySpec; 41 KeySpec keySpec) 44 if (keySpec instanceof PBEKeySpec) 46 PBEKeySpec pbeSpec = (PBEKeySpec)keySpec; 66 throw new InvalidKeySpecException("Invalid KeySpec");
|
/libcore/crypto/src/main/java/org/conscrypt/ |
OpenSSLRSAKeyFactory.java | 29 import java.security.spec.KeySpec; 39 protected PublicKey engineGeneratePublic(KeySpec keySpec) throws InvalidKeySpecException { 40 if (keySpec == null) { 41 throw new InvalidKeySpecException("keySpec == null"); 44 if (keySpec instanceof RSAPublicKeySpec) { 45 return new OpenSSLRSAPublicKey((RSAPublicKeySpec) keySpec); 46 } else if (keySpec instanceof X509EncodedKeySpec) { 47 return OpenSSLKey.getPublicKey((X509EncodedKeySpec) keySpec, NativeCrypto.EVP_PKEY_RSA); 50 + keySpec.getClass().getName()) [all...] |
OpenSSLDSAKeyFactory.java | 31 import java.security.spec.KeySpec; 38 protected PublicKey engineGeneratePublic(KeySpec keySpec) throws InvalidKeySpecException { 39 if (keySpec == null) { 40 throw new InvalidKeySpecException("keySpec == null"); 43 if (keySpec instanceof DSAPublicKeySpec) { 44 return new OpenSSLDSAPublicKey((DSAPublicKeySpec) keySpec); 45 } else if (keySpec instanceof X509EncodedKeySpec) { 46 return OpenSSLKey.getPublicKey((X509EncodedKeySpec) keySpec, NativeCrypto.EVP_PKEY_DSA); 49 + keySpec.getClass().getName()) [all...] |
OpenSSLECKeyFactory.java | 32 import java.security.spec.KeySpec; 39 protected PublicKey engineGeneratePublic(KeySpec keySpec) throws InvalidKeySpecException { 40 if (keySpec == null) { 41 throw new InvalidKeySpecException("keySpec == null"); 44 if (keySpec instanceof ECPublicKeySpec) { 45 return new OpenSSLECPublicKey((ECPublicKeySpec) keySpec); 46 } else if (keySpec instanceof X509EncodedKeySpec) { 47 return OpenSSLKey.getPublicKey((X509EncodedKeySpec) keySpec, NativeCrypto.EVP_PKEY_EC); 50 + keySpec.getClass().getName()) [all...] |
/libcore/luni/src/main/java/javax/crypto/ |
SecretKeyFactorySpi.java | 22 import java.security.spec.KeySpec; 39 * @param keySpec 46 protected abstract SecretKey engineGenerateSecret(KeySpec keySpec) 54 * @param keySpec 62 protected abstract KeySpec engineGetKeySpec(SecretKey key, Class keySpec)
|
SecretKeyFactory.java | 26 import java.security.spec.KeySpec; 35 * <li>convert {@link SecretKey} objects to and from {@link KeySpec} objects</li> 177 * @param keySpec 184 public final SecretKey generateSecret(KeySpec keySpec) 186 return spiImpl.engineGenerateSecret(keySpec); 194 * @param keySpec 202 public final KeySpec getKeySpec(SecretKey key, Class keySpec) 204 return spiImpl.engineGetKeySpec(key, keySpec); [all...] |
/external/bouncycastle/bcprov/src/main/java/org/bouncycastle/jcajce/provider/asymmetric/util/ |
BaseKeyFactorySpi.java | 8 import java.security.spec.KeySpec; 21 KeySpec keySpec) 24 if (keySpec instanceof PKCS8EncodedKeySpec) 28 return generatePrivate(PrivateKeyInfo.getInstance(((PKCS8EncodedKeySpec)keySpec).getEncoded())); 42 KeySpec keySpec) 45 if (keySpec instanceof X509EncodedKeySpec) 49 return generatePublic(SubjectPublicKeyInfo.getInstance(((X509EncodedKeySpec)keySpec).getEncoded())); 62 protected KeySpec engineGetKeySpec [all...] |
/external/bouncycastle/bcprov/src/main/java/org/bouncycastle/jcajce/provider/asymmetric/rsa/ |
KeyFactorySpi.java | 11 import java.security.spec.KeySpec; 31 protected KeySpec engineGetKeySpec( 84 KeySpec keySpec) 87 if (keySpec instanceof PKCS8EncodedKeySpec) 91 return generatePrivate(PrivateKeyInfo.getInstance(((PKCS8EncodedKeySpec)keySpec).getEncoded())); 101 RSAPrivateKey.getInstance(((PKCS8EncodedKeySpec)keySpec).getEncoded())); 109 else if (keySpec instanceof RSAPrivateCrtKeySpec) 111 return new BCRSAPrivateCrtKey((RSAPrivateCrtKeySpec)keySpec); 113 else if (keySpec instanceof RSAPrivateKeySpec [all...] |
/external/apache-harmony/crypto/src/test/support/common/java/org/apache/harmony/crypto/tests/support/ |
MySecretKeyFactorySpi.java | 26 import java.security.spec.KeySpec; 39 protected SecretKey engineGenerateSecret(KeySpec keySpec) 46 protected KeySpec engineGetKeySpec(SecretKey key, Class keySpec)
|
/external/bouncycastle/bcprov/src/main/java/org/bouncycastle/jcajce/provider/asymmetric/dh/ |
KeyFactorySpi.java | 9 import java.security.spec.KeySpec; 30 protected KeySpec engineGetKeySpec( 68 KeySpec keySpec) 71 if (keySpec instanceof DHPrivateKeySpec) 73 return new BCDHPrivateKey((DHPrivateKeySpec)keySpec); 76 return super.engineGeneratePrivate(keySpec); 80 KeySpec keySpec) 83 if (keySpec instanceof DHPublicKeySpec [all...] |
/external/bouncycastle/bcprov/src/main/java/org/bouncycastle/jcajce/provider/asymmetric/dsa/ |
KeyFactorySpi.java | 13 import java.security.spec.KeySpec; 27 protected KeySpec engineGetKeySpec( 95 KeySpec keySpec) 98 if (keySpec instanceof DSAPrivateKeySpec) 100 return new BCDSAPrivateKey((DSAPrivateKeySpec)keySpec); 103 return super.engineGeneratePrivate(keySpec); 107 KeySpec keySpec) 110 if (keySpec instanceof DSAPublicKeySpec [all...] |
/libcore/luni/src/test/java/org/apache/harmony/crypto/tests/support/ |
MySecretKeyFactorySpi.java | 27 import java.security.spec.KeySpec; 40 protected SecretKey engineGenerateSecret(KeySpec keySpec) 47 protected KeySpec engineGetKeySpec(SecretKey key, Class keySpec)
|
/libcore/luni/src/test/java/org/apache/harmony/security/tests/java/security/ |
KeyFactoryTest.java | 19 import java.security.spec.KeySpec; 190 TestPublicKeySpec keySpec = new TestPublicKeySpec(key); 191 PublicKey publicKey = factory.generatePublic(keySpec); 198 KeySpec[] keySpecs = { 211 KeySpec keySpec = keySpecs[i]; 213 (keySpec == null ? "null" : keySpec.toString()) + ")"; 216 PublicKey generatePublic = factory.generatePublic(keySpec); 239 TestPrivateKeySpec keySpec = new TestPrivateKeySpec(key) [all...] |
KeyFactorySpiTest.java | 22 import java.security.spec.KeySpec; 43 KeySpec ks = new MyKeySpec(); 44 KeySpec kss = new MyKeySpec(); 56 protected PrivateKey engineGeneratePrivate(KeySpec keySpec){ 59 protected PublicKey engineGeneratePublic(KeySpec keySpec){ 62 protected KeySpec engineGetKeySpec(Key key, Class keySpec){ 70 class MyKeySpec implements KeySpec {} [all...] |
/libcore/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/ |
SecretKeyFactorySpiTest.java | 27 import java.security.spec.KeySpec; 41 protected SecretKey engineGenerateSecret(KeySpec keySpec) throws InvalidKeySpecException { 42 return super.engineGenerateSecret(keySpec); 46 protected KeySpec engineGetKeySpec(SecretKey key, Class keySpec) 48 return super.engineGetKeySpec(key, keySpec); 67 KeySpec kspec = null;
|
/external/mdnsresponder/mDNSShared/ |
dnsextd_parser.y | 58 typedef struct KeySpec 63 struct KeySpec * next; 64 } KeySpec; 79 static KeySpec * g_keys; 200 KeySpec * keySpec; 202 keySpec = ( KeySpec* ) malloc( sizeof( KeySpec ) ); 204 if ( !keySpec ) [all...] |
/external/bouncycastle/bcprov/src/main/java/org/bouncycastle/jcajce/provider/asymmetric/ec/ |
KeyFactorySpi.java | 11 import java.security.spec.KeySpec; 57 protected KeySpec engineGetKeySpec( 125 KeySpec keySpec) 128 if (keySpec instanceof ECPrivateKeySpec) 130 return new BCECPrivateKey(algorithm, (ECPrivateKeySpec)keySpec, configuration); 132 else if (keySpec instanceof java.security.spec.ECPrivateKeySpec) 134 return new BCECPrivateKey(algorithm, (java.security.spec.ECPrivateKeySpec)keySpec, configuration); 137 return super.engineGeneratePrivate(keySpec); 141 KeySpec keySpec [all...] |
/libcore/luni/src/main/java/org/apache/harmony/security/x509/ |
SubjectPublicKeyInfo.java | 29 import java.security.spec.KeySpec; 112 final KeySpec keySpec = new X509EncodedKeySpec(encoded); 116 publicKey = generateKeyForAlgorithm(keySpec, algName); 124 publicKey = generateKeyForAlgorithm(keySpec, algOid); 140 * Try to generate a PublicKey for a given {@code keySpec} and 142 * a missing {@code KeyFactory} or invalid {@code KeySpec}, it will return 145 private static PublicKey generateKeyForAlgorithm(KeySpec keySpec, String algorithm) { 147 return KeyFactory.getInstance(algorithm).generatePublic(keySpec); [all...] |