HomeSort by relevance Sort by last modified time
    Searched refs:NativeCrypto (Results 1 - 25 of 49) sorted by null

1 2

  /libcore/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/
OpenSSLX509CRLEntry.java 40 NativeCrypto.get_X509_REVOKED_ext_oids(mContext,
41 NativeCrypto.EXTENSION_TYPE_CRITICAL);
49 && (NativeCrypto.get_X509_REVOKED_ext_oids(mContext,
50 NativeCrypto.EXTENSION_TYPE_NON_CRITICAL).length == 0)) {
59 return NativeCrypto.X509_REVOKED_get_ext_oid(mContext, oid);
65 NativeCrypto.get_X509_REVOKED_ext_oids(mContext,
66 NativeCrypto.EXTENSION_TYPE_NON_CRITICAL);
74 && (NativeCrypto.get_X509_REVOKED_ext_oids(mContext,
75 NativeCrypto.EXTENSION_TYPE_CRITICAL).length == 0)) {
85 NativeCrypto.get_X509_REVOKED_ext_oids(mContext
    [all...]
OpenSSLMac.java 30 NativeCrypto.EVP_MD_CTX_create());
88 macKey = new OpenSSLKey(NativeCrypto.EVP_PKEY_new_mac_key(evp_pkey_type, keyBytes));
91 NativeCrypto.EVP_MD_CTX_init(ctx.getContext());
97 NativeCrypto.EVP_DigestSignInit(ctx.getContext(), evp_md, macKey.getPkeyContext());
108 NativeCrypto.EVP_DigestUpdate(ctx.getContext(), input, offset, len);
113 final byte[] output = NativeCrypto.EVP_DigestSignFinal(ctx.getContext());
124 private static final long EVP_MD = NativeCrypto.EVP_get_digestbyname("md5");
125 private static final int SIZE = NativeCrypto.EVP_MD_size(EVP_MD);
128 super(EVP_MD, SIZE, NativeCrypto.EVP_PKEY_HMAC);
133 private static final long EVP_MD = NativeCrypto.EVP_get_digestbyname("sha1")
    [all...]
OpenSSLMessageDigestJDK.java 76 NativeCrypto.EVP_DigestUpdate(getCtx(), input, offset, len);
82 NativeCrypto.EVP_DigestFinal(getCtx(), result, 0);
89 d.ctx = NativeCrypto.EVP_MD_CTX_copy(getCtx());
95 ctx = NativeCrypto.EVP_DigestInit(evp_md);
102 NativeCrypto.EVP_MD_CTX_destroy(ctx);
116 private static final long EVP_MD = NativeCrypto.EVP_get_digestbyname("md5");
117 private static final int SIZE = NativeCrypto.EVP_MD_size(EVP_MD);
124 private static final long EVP_MD = NativeCrypto.EVP_get_digestbyname("sha1");
125 private static final int SIZE = NativeCrypto.EVP_MD_size(EVP_MD);
132 private static final long EVP_MD = NativeCrypto.EVP_get_digestbyname("sha256")
    [all...]
OpenSSLRandom.java 27 NativeCrypto.RAND_seed(seed);
32 NativeCrypto.RAND_bytes(bytes);
38 NativeCrypto.RAND_bytes(output);
OpenSSLECGroupContext.java 45 final long ctx = NativeCrypto.EC_GROUP_new_by_curve_name(curveName);
50 NativeCrypto.EC_GROUP_set_point_conversion_form(ctx,
51 NativeCrypto.POINT_CONVERSION_UNCOMPRESSED);
52 NativeCrypto.EC_GROUP_set_asn1_flag(ctx, NativeCrypto.OPENSSL_EC_NAMED_CURVE);
59 final long ctx = NativeCrypto.EC_GROUP_new_curve(type, p.toByteArray(), a.toByteArray(),
65 NativeCrypto.EC_GROUP_set_point_conversion_form(ctx,
66 NativeCrypto.POINT_CONVERSION_UNCOMPRESSED);
71 NativeCrypto.EC_POINT_new(ctx));
73 NativeCrypto.EC_POINT_set_affine_coordinates(ctx, generator.getContext()
    [all...]
OpenSSLX509CRL.java 60 final long crlCtx = NativeCrypto.d2i_X509_CRL_bio(bis.getBioContext());
68 NativeCrypto.BIO_free(bis.getBioContext());
78 certRefs = NativeCrypto.d2i_PKCS7_bio(bis.getBioContext(), NativeCrypto.PKCS7_CRLS);
82 NativeCrypto.BIO_free(bis.getBioContext());
99 final long crlCtx = NativeCrypto.PEM_read_bio_X509_CRL(bis.getBioContext());
107 NativeCrypto.BIO_free(bis.getBioContext());
117 certRefs = NativeCrypto.PEM_read_bio_PKCS7(bis.getBioContext(),
118 NativeCrypto.PKCS7_CRLS);
122 NativeCrypto.BIO_free(bis.getBioContext())
    [all...]
OpenSSLEngine.java 27 NativeCrypto.ENGINE_load_dynamic();
42 engineCtx = NativeCrypto.ENGINE_by_id(engine);
47 NativeCrypto.ENGINE_add(engineCtx);
56 if (NativeCrypto.ENGINE_init(engineCtx) == 0) {
57 NativeCrypto.ENGINE_free(engineCtx);
67 final long keyRef = NativeCrypto.ENGINE_load_private_key(ctx, id);
85 final long keyRef = NativeCrypto.ENGINE_load_private_key(ctx, id);
105 NativeCrypto.ENGINE_finish(ctx);
106 NativeCrypto.ENGINE_free(ctx);
128 final String id = NativeCrypto.ENGINE_get_id(ctx)
    [all...]
OpenSSLX509Certificate.java 67 final long certCtx = NativeCrypto.d2i_X509_bio(bis.getBioContext());
75 NativeCrypto.BIO_free(bis.getBioContext());
80 final long certCtx = NativeCrypto.d2i_X509(encoded);
93 certRefs = NativeCrypto.d2i_PKCS7_bio(bis.getBioContext(), NativeCrypto.PKCS7_CERTS);
97 NativeCrypto.BIO_free(bis.getBioContext());
120 final long certCtx = NativeCrypto.PEM_read_bio_X509(bis.getBioContext());
128 NativeCrypto.BIO_free(bis.getBioContext());
138 certRefs = NativeCrypto.PEM_read_bio_PKCS7(bis.getBioContext(),
139 NativeCrypto.PKCS7_CERTS)
    [all...]
OpenSSLKey.java 69 switch (NativeCrypto.EVP_PKEY_type(ctx)) {
70 case NativeCrypto.EVP_PKEY_RSA:
72 case NativeCrypto.EVP_PKEY_DSA:
74 case NativeCrypto.EVP_PKEY_EC:
87 key = new OpenSSLKey(NativeCrypto.d2i_PUBKEY(x509KeySpec.getEncoded()));
92 if (NativeCrypto.EVP_PKEY_type(key.getPkeyContext()) != type) {
104 switch (NativeCrypto.EVP_PKEY_type(ctx)) {
105 case NativeCrypto.EVP_PKEY_RSA:
107 case NativeCrypto.EVP_PKEY_DSA:
109 case NativeCrypto.EVP_PKEY_EC
    [all...]
OpenSSLECPointContext.java 35 NativeCrypto.EC_POINT_clear_free(pointCtx);
49 if (!NativeCrypto.EC_GROUP_cmp(group.getContext(), other.group.getContext())) {
53 return NativeCrypto.EC_POINT_cmp(group.getContext(), pointCtx, other.pointCtx);
57 final byte[][] generatorCoords = NativeCrypto.EC_POINT_get_affine_coordinates(
77 NativeCrypto.EC_POINT_new(group.getContext()));
78 NativeCrypto.EC_POINT_set_affine_coordinates(group.getContext(),
OpenSSLECPublicKey.java 48 final long origGroup = NativeCrypto.EC_KEY_get0_group(key.getPkeyContext());
49 this.group = new OpenSSLECGroupContext(NativeCrypto.EC_GROUP_dup(origGroup));
57 NativeCrypto.get_EC_GROUP_type(group.getContext()), group, ecKeySpec.getW());
58 key = new OpenSSLKey(NativeCrypto.EVP_PKEY_new_EC_KEY(group.getContext(),
70 NativeCrypto.get_EC_GROUP_type(group.getContext()), group, ecPublicKey.getW());
71 return new OpenSSLKey(NativeCrypto.EVP_PKEY_new_EC_KEY(group.getContext(),
90 return NativeCrypto.i2d_PUBKEY(key.getPkeyContext());
100 NativeCrypto.EC_KEY_get_public_key(key.getPkeyContext()));
146 return Arrays.hashCode(NativeCrypto.i2d_PUBKEY(key.getPkeyContext()));
151 return NativeCrypto.EVP_PKEY_print_public(key.getPkeyContext())
    [all...]
OpenSSLSocketImpl.java 65 implements NativeCrypto.SSLHandshakeCallbacks {
178 NativeCrypto.getDefaultProtocols(),
179 NativeCrypto.getDefaultCipherSuites());
259 final int seedLengthInBytes = NativeCrypto.RAND_SEED_LENGTH_IN_BYTES;
262 NativeCrypto.RAND_load_file("/dev/urandom", seedLengthInBytes);
264 NativeCrypto.RAND_seed(secureRandom.generateSeed(seedLengthInBytes));
276 sslNativePointer = NativeCrypto.SSL_new(sslCtxNativePointer);
280 NativeCrypto.SSL_CTX_enable_npn(sslCtxNativePointer);
288 if (enabledCipherSuite.equals(NativeCrypto.TLS_EMPTY_RENEGOTIATION_INFO_SCSV)) {
307 NativeCrypto.setEnabledProtocols(sslNativePointer, enabledProtocols)
    [all...]
OpenSSLECPrivateKey.java 47 final long origGroup = NativeCrypto.EC_KEY_get0_group(key.getPkeyContext());
48 this.group = new OpenSSLECGroupContext(NativeCrypto.EC_GROUP_dup(origGroup));
56 key = new OpenSSLKey(NativeCrypto.EVP_PKEY_new_EC_KEY(group.getContext(), 0,
68 return new OpenSSLKey(NativeCrypto.EVP_PKEY_new_EC_KEY(group.getContext(), 0,
87 return NativeCrypto.i2d_PKCS8_PRIV_KEY_INFO(key.getPkeyContext());
105 return new BigInteger(NativeCrypto.EC_KEY_get_private_key(key.getPkeyContext()));
144 return Arrays.hashCode(NativeCrypto.i2d_PKCS8_PRIV_KEY_INFO(key.getPkeyContext()));
149 return NativeCrypto.EVP_PKEY_print_private(key.getPkeyContext());
157 key = new OpenSSLKey(NativeCrypto.d2i_PKCS8_PRIV_KEY_INFO(encoded));
159 final long origGroup = NativeCrypto.EC_KEY_get0_group(key.getPkeyContext())
    [all...]
OpenSSLCipherContext.java 33 NativeCrypto.EVP_CIPHER_CTX_cleanup(context);
OpenSSLDigestContext.java 33 NativeCrypto.EVP_MD_CTX_destroy(context);
OpenSSLSecretKey.java 41 type = NativeCrypto.EVP_PKEY_HMAC;
42 key = new OpenSSLKey(NativeCrypto.EVP_PKEY_new_mac_key(type, encoded));
49 type = NativeCrypto.EVP_PKEY_type(key.getPkeyContext());
55 return new OpenSSLKey(NativeCrypto.EVP_PKEY_new_mac_key(NativeCrypto.EVP_PKEY_HMAC,
127 key = new OpenSSLKey(NativeCrypto.EVP_PKEY_new_mac_key(type, encoded));
OpenSSLSignature.java 97 ctx = NativeCrypto.EVP_SignInit(evpAlgorithm);
103 NativeCrypto.EVP_SignUpdate(ctx, input, offset, len);
107 ctx = NativeCrypto.EVP_VerifyInit(evpAlgorithm);
113 NativeCrypto.EVP_VerifyUpdate(ctx, input, offset, len);
123 final int pkeyType = NativeCrypto.EVP_PKEY_type(pkey.getPkeyContext());
127 if (pkeyType != NativeCrypto.EVP_PKEY_RSA) {
132 if (pkeyType != NativeCrypto.EVP_PKEY_DSA) {
137 if (pkeyType != NativeCrypto.EVP_PKEY_EC) {
234 byte[] buffer = new byte[NativeCrypto.EVP_PKEY_size(key.getPkeyContext())];
235 int bytesWritten = NativeCrypto.EVP_SignFinal(ctx, buffer, 0, key.getPkeyContext())
    [all...]
OpenSSLServerSocketImpl.java 33 private String[] enabledProtocols = NativeCrypto.getSupportedProtocols();
34 private String[] enabledCipherSuites = NativeCrypto.getDefaultCipherSuites();
79 return NativeCrypto.getSupportedProtocols();
103 enabledProtocols = NativeCrypto.checkEnabledProtocols(protocols);
108 return NativeCrypto.getSupportedCipherSuites();
140 enabledCipherSuites = NativeCrypto.checkEnabledCipherSuites(suites);
200 if (enabledCipherSuite.equals(NativeCrypto.TLS_EMPTY_RENEGOTIATION_INFO_SCSV)) {
OpenSSLCipherRSA.java 80 private int padding = NativeCrypto.RSA_PKCS1_PADDING;
100 this.padding = NativeCrypto.RSA_PKCS1_PADDING;
104 this.padding = NativeCrypto.RSA_NO_PADDING;
129 if (padding == NativeCrypto.RSA_PKCS1_PADDING) {
140 return NativeCrypto.RSA_size(this.key.getPkeyContext());
186 buffer = new byte[NativeCrypto.RSA_size(this.key.getPkeyContext())];
249 if (padding == NativeCrypto.RSA_NO_PADDING) {
263 resultSize = NativeCrypto.RSA_private_encrypt(tmpBuf.length, tmpBuf, output,
266 resultSize = NativeCrypto.RSA_public_encrypt(tmpBuf.length, tmpBuf, output,
272 resultSize = NativeCrypto.RSA_private_decrypt(tmpBuf.length, tmpBuf, output
    [all...]
OpenSSLSignatureRawRSA.java 109 int maxSize = NativeCrypto.RSA_size(key.getPkeyContext());
127 int maxSize = NativeCrypto.RSA_size(key.getPkeyContext());
150 NativeCrypto.RSA_private_encrypt(inputOffset, inputBuffer, outputBuffer,
151 key.getPkeyContext(), NativeCrypto.RSA_PKCS1_PADDING);
175 resultSize = NativeCrypto.RSA_public_decrypt(sigBytes.length, sigBytes,
176 outputBuffer, key.getPkeyContext(), NativeCrypto.RSA_PKCS1_PADDING);
OpenSSLBIOInputStream.java 34 ctx = NativeCrypto.create_BIO_InputStream(this);
OpenSSLServerSocketFactoryImpl.java 46 return NativeCrypto.getDefaultCipherSuites();
50 return NativeCrypto.getSupportedCipherSuites();
OpenSSLSessionImpl.java 80 this(NativeCrypto.d2i_SSL_SESSION(derData),
112 id = NativeCrypto.SSL_SESSION_session_id(sslSessionNativePointer);
120 return NativeCrypto.i2d_SSL_SESSION(sslSessionNativePointer);
129 creationTime = NativeCrypto.SSL_SESSION_get_time(sslSessionNativePointer);
309 String name = NativeCrypto.SSL_SESSION_cipher(sslSessionNativePointer);
310 cipherSuite = NativeCrypto.OPENSSL_TO_STANDARD_CIPHER_SUITES.get(name);
324 protocol = NativeCrypto.SSL_SESSION_get_version(sslSessionNativePointer);
446 NativeCrypto.SSL_SESSION_free(sslSessionNativePointer);
  /external/bouncycastle/bcprov/src/main/java/org/bouncycastle/crypto/digests/
OpenSSLDigest.java 19 import org.apache.harmony.xnet.provider.jsse.NativeCrypto;
92 NativeCrypto.EVP_DigestUpdate(getCtx(), in, inOff, len);
96 int i = NativeCrypto.EVP_DigestFinal(getCtx(), out, outOff);
104 ctx = NativeCrypto.EVP_DigestInit(evp_md);
111 NativeCrypto.EVP_MD_CTX_destroy(ctx);
126 private static final long EVP_MD = NativeCrypto.EVP_get_digestbyname("md5");
127 private static final int SIZE = NativeCrypto.EVP_MD_size(EVP_MD);
128 private static final int BLOCK_SIZE = NativeCrypto.EVP_MD_block_size(EVP_MD);
133 private static final long EVP_MD = NativeCrypto.EVP_get_digestbyname("sha1");
134 private static final int SIZE = NativeCrypto.EVP_MD_size(EVP_MD)
    [all...]
  /libcore/luni/src/test/java/org/apache/harmony/xnet/provider/jsse/
NativeCryptoTest.java 56 import org.apache.harmony.xnet.provider.jsse.NativeCrypto.SSLHandshakeCallbacks;
57 import static org.apache.harmony.xnet.provider.jsse.NativeCrypto.SSL_MODE_HANDSHAKE_CUTTHROUGH;
80 assertEquals(0, NativeCrypto.ERR_peek_last_error());
120 SERVER_CERTIFICATES = NativeCrypto.encodeCertificates(
126 CLIENT_CERTIFICATES = NativeCrypto.encodeCertificates(
160 assertEqualByteArrays(NativeCrypto.SSL_SESSION_session_id(expected),
161 NativeCrypto.SSL_SESSION_session_id(actual));
179 NativeCrypto.EVP_PKEY_cmp(NULL, NULL);
195 pkey1 = NativeCrypto.EVP_PKEY_new_RSA(privKey1.getModulus().toByteArray(),
205 pkey1_copy = NativeCrypto.EVP_PKEY_new_RSA(privKey1.getModulus().toByteArray()
    [all...]

Completed in 146 milliseconds

1 2