Home
last modified time | relevance | path

Searched refs:encoded (Results 1 – 25 of 44) sorted by relevance

12

/libcore/ojluni/src/main/java/javax/net/ssl/
DSNIServerName.java53 private final byte[] encoded; field in SNIServerName
74 protected SNIServerName(int type, byte[] encoded) { in SNIServerName() argument
84 if (encoded == null) { in SNIServerName()
88 this.encoded = encoded.clone(); in SNIServerName()
107 return encoded.clone(); in getEncoded()
129 Arrays.equals(this.encoded, that.encoded); in equals()
144 result = 31 * result + Arrays.hashCode(encoded); in hashCode()
184 return "type=host_name (0), value=" + toHexString(encoded); in toString()
186 return "type=(" + type + "), value=" + toHexString(encoded); in toString()
DSNIHostName.java162 public SNIHostName(byte[] encoded) { in SNIHostName() argument
164 super(StandardConstants.SNI_HOST_NAME, encoded); in SNIHostName()
176 decoder.decode(ByteBuffer.wrap(encoded)).toString()); in SNIHostName()
/libcore/luni/src/main/java/libcore/util/
DHexEncoding.java58 …public static byte[] decode(char[] encoded, boolean allowSingleChar) throws IllegalArgumentExcepti… in decode() argument
59 int resultLengthBytes = (encoded.length + 1) / 2; in decode()
65 if ((encoded.length % 2) != 0) { in decode()
67 result[resultOffset++] = (byte) toDigit(encoded, i); in decode()
71 if ((encoded.length % 2) != 0) { in decode()
72 throw new IllegalArgumentException("Invalid input length: " + encoded.length); in decode()
76 for (int len = encoded.length; i < len; i += 2) { in decode()
77 result[resultOffset++] = (byte) ((toDigit(encoded, i) << 4) | toDigit(encoded, i + 1)); in decode()
/libcore/ojluni/src/main/java/javax/crypto/
DEncryptedPrivateKeyInfo.java67 private byte[] encoded = null; field in EncryptedPrivateKeyInfo
77 public EncryptedPrivateKeyInfo(byte[] encoded) in EncryptedPrivateKeyInfo() argument
79 if (encoded == null) { in EncryptedPrivateKeyInfo()
83 this.encoded = (byte[])encoded.clone(); in EncryptedPrivateKeyInfo()
84 DerValue val = new DerValue(this.encoded); in EncryptedPrivateKeyInfo()
150 this.encoded = null; in EncryptedPrivateKeyInfo()
191 this.encoded = null; in EncryptedPrivateKeyInfo()
248 byte[] encoded = null; in getKeySpec()
250 encoded = cipher.doFinal((byte[])encryptedData); in getKeySpec()
251 checkPKCS8Encoding(encoded); in getKeySpec()
[all …]
/libcore/support/src/test/java/org/apache/harmony/security/tests/support/
DKeyStoreTestSupport.java66 private byte[] encoded; field in KeyStoreTestSupport.SKey
68 public SKey(String type, byte[] encoded) { in SKey() argument
70 this.encoded = encoded; in SKey()
78 return encoded; in getEncoded()
94 private byte[] encoded; field in KeyStoreTestSupport.MyPrivateKey
96 public MyPrivateKey(String algorithm, String format, byte[] encoded) { in MyPrivateKey() argument
99 this.encoded = encoded; in MyPrivateKey()
111 return encoded; in getEncoded()
DPrivateKeyStub.java37 byte [] encoded = null; field in PrivateKeyStub
47 public PrivateKeyStub(String algorithm, String format, byte[] encoded) { in PrivateKeyStub() argument
50 this.encoded = encoded; in PrivateKeyStub()
74 return encoded; in getEncoded()
DPublicKeyStub.java40 byte [] encoded = null; field in PublicKeyStub
45 public PublicKeyStub(String algorithm, String format, byte[] encoded) { in PublicKeyStub() argument
48 this.encoded = encoded; in PublicKeyStub()
71 return encoded; in getEncoded()
DMyKeyPairGenerator1.java99 private byte[] encoded; field in MyKeyPairGenerator1.PubKey
104 this.encoded = new byte[10]; in PubKey()
116 return encoded; in getEncoded()
125 private byte[] encoded; field in MyKeyPairGenerator1.PrivKey
130 this.encoded = new byte[10]; in PrivKey()
142 return encoded; in getEncoded()
DTestCertUtils.java151 private static final byte[] encoded = new byte[] { 1, 2, 3, 4, 5, 6, 7, field in TestCertUtils.TestCertPath
192 return encoded.clone(); in getEncoded()
200 return encoded.clone(); in getEncoded()
280 private static final byte[] encoded = new byte[] { 1, 2, 3, 4, 5, 6, 7, field in TestCertUtils.TestPublicKey
290 return encoded.clone(); in getEncoded()
306 private static final byte[] encoded = new byte[] { 1, 2, 3, 4, 5, 6, 7, field in TestCertUtils.TestCertificate
346 return encoded.clone(); in getEncoded()
/libcore/ojluni/src/main/java/java/security/
DKeyRep.java109 private byte[] encoded; field in KeyRep
131 String format, byte[] encoded) { in KeyRep() argument
134 format == null || encoded == null) { in KeyRep()
141 this.encoded = encoded.clone(); in KeyRep()
171 return new SecretKeySpec(encoded, algorithm); in readResolve()
174 return f.generatePublic(new X509EncodedKeySpec(encoded)); in readResolve()
177 return f.generatePrivate(new PKCS8EncodedKeySpec(encoded)); in readResolve()
/libcore/ojluni/src/main/java/sun/security/provider/certpath/
DX509CertificatePair.java80 private byte[] encoded; field in X509CertificatePair
118 private X509CertificatePair(byte[] encoded) throws CertificateException { in X509CertificatePair() argument
120 parse(new DerValue(encoded)); in X509CertificatePair()
121 this.encoded = encoded; in X509CertificatePair()
140 (byte[] encoded) throws CertificateException { in generateCertificatePair() argument
141 Object key = new Cache.EqualByteArray(encoded); in generateCertificatePair()
146 pair = new X509CertificatePair(encoded); in generateCertificatePair()
147 key = new Cache.EqualByteArray(pair.encoded); in generateCertificatePair()
194 if (encoded == null) { in getEncoded()
197 encoded = tmp.toByteArray(); in getEncoded()
[all …]
/libcore/ojluni/src/main/java/sun/security/ssl/
DRSAClientKeyExchange.java189 byte[] encoded = secretKey.getEncoded(); in polishPreMasterSecretKey()
190 if (encoded == null) { // unable to get the encoded key in polishPreMasterSecretKey()
212 } else if (encoded.length == 48) { in polishPreMasterSecretKey()
214 if (clientHelloVersion.major == encoded[0] && in polishPreMasterSecretKey()
215 clientHelloVersion.minor == encoded[1]) { in polishPreMasterSecretKey()
219 currentVersion.major == encoded[0] && in polishPreMasterSecretKey()
220 currentVersion.minor == encoded[1]) { in polishPreMasterSecretKey()
234 ProtocolVersion.valueOf(encoded[0], encoded[1])); in polishPreMasterSecretKey()
242 encoded.length); in polishPreMasterSecretKey()
/libcore/luni/src/test/java/org/apache/harmony/security/tests/java/security/
DKeyFactoryTest.java193 assertTrue(Arrays.equals(key.encoded, publicKey.getEncoded())); in testGeneratePublic()
435 return new TestPrivateKey(((TestPrivateKeySpec)keySpec).encoded); in engineGeneratePrivate()
445 return new TestPublicKey(((TestPublicKeySpec)keySpec).encoded); in engineGeneratePublic()
508 private final byte[] encoded; field in KeyFactoryTest.TestPrivateKeySpec
511 this.encoded = key.getEncoded(); in TestPrivateKeySpec()
517 private final byte[] encoded; field in KeyFactoryTest.TestPublicKeySpec
520 this.encoded = key.getEncoded(); in TestPublicKeySpec()
526 private final byte[] encoded; field in KeyFactoryTest.TestPrivateKey
529 encoded = new byte[] {3, 4, 5}; in TestPrivateKey()
532 public TestPrivateKey(byte[] encoded) { in TestPrivateKey() argument
[all …]
/libcore/luni/src/test/java/libcore/java/net/
DUrlEncodingTest.java258 private void assertEncoded(String encoded, String original) throws Exception { in assertEncoded() argument
259 assertEquals(encoded, URLEncoder.encode(original, "UTF-8")); in assertEncoded()
260 assertEquals(encoded, URLEncoder.encode(original)); in assertEncoded()
261 assertEquals(encoded, new URI("http", "foo", "/", original).getRawFragment()); in assertEncoded()
264 private void assertRoundTrip(String original, String encoded) throws Exception { in assertRoundTrip() argument
265 assertEquals(encoded, URLEncoder.encode(original, "UTF-8")); in assertRoundTrip()
266 assertEquals(original, URLDecoder.decode(encoded, "UTF-8")); in assertRoundTrip()
/libcore/luni/src/test/java/libcore/java/security/spec/
DAlgorithmParametersPSSTest.java114 byte[] encoded, PSSParameterSpec expected) throws Exception { in assertInitWithDerEncoded() argument
116 params.init(encoded); in assertInitWithDerEncoded()
120 params.init(encoded, "ASN.1"); in assertInitWithDerEncoded()
145 byte[] encoded = params.getEncoded("ASN.1"); in assertGetEncoded()
146 assertTrue(Arrays.equals(expectedEncoded, encoded)); in assertGetEncoded()
148 assertTrue(Arrays.equals(encoded, params.getEncoded())); in assertGetEncoded()
210 private static final byte[] hexDecode(String encoded) { in hexDecode() argument
211 return HexEncoding.decode(encoded.toCharArray(), false); in hexDecode()
/libcore/luni/src/test/java/tests/security/spec/
DEncodedKeySpec2Test.java49 byte[] encoded = keys.getPublic().getEncoded(); in test_getEncoded()
50 Key key = fact.generatePublic(new X509EncodedKeySpec(encoded)); in test_getEncoded()
56 encoded = keys.getPrivate().getEncoded(); in test_getEncoded()
57 key = fact.generatePrivate(new PKCS8EncodedKeySpec(encoded)); in test_getEncoded()
/libcore/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/func/
DCipherThread.java50 public void checkEncodedData(byte[] original, byte[] encoded) in checkEncodedData() argument
53 if (original[i] != encoded[i]) { in checkEncodedData()
60 public void checkPaddedEncodedData(byte[] original, byte[] encoded, int offset) in checkPaddedEncodedData() argument
63 if (encoded[i] != 0) { in checkPaddedEncodedData()
68 if (original[i] != encoded[i + offset]) { in checkPaddedEncodedData()
/libcore/ojluni/src/main/java/java/security/cert/
DPolicyQualifierInfo.java100 public PolicyQualifierInfo(byte[] encoded) throws IOException { in PolicyQualifierInfo() argument
101 mEncoded = encoded.clone(); in PolicyQualifierInfo()
DPKIXRevocationChecker.java266 byte[] encoded = entry.getValue(); in clone()
267 entry.setValue(encoded.clone()); in clone()
/libcore/ojluni/src/main/java/sun/security/x509/
DX509Key.java316 byte[] encoded = encodedKey; in getEncodedInternal()
317 if (encoded == null) { in getEncodedInternal()
321 encoded = out.toByteArray(); in getEncodedInternal()
326 encodedKey = encoded; in getEncodedInternal()
328 return encoded; in getEncodedInternal()
/libcore/ojluni/src/main/java/sun/security/ec/
DECPublicKeyImpl.java67 public ECPublicKeyImpl(byte[] encoded) throws InvalidKeyException { in ECPublicKeyImpl() argument
68 decode(encoded); in ECPublicKeyImpl()
DECPrivateKeyImpl.java73 public ECPrivateKeyImpl(byte[] encoded) throws InvalidKeyException { in ECPrivateKeyImpl() argument
74 decode(encoded); in ECPrivateKeyImpl()
DNamedCurve.java54 private final byte[] encoded; field in NamedCurve
64 encoded = out.toByteArray(); in NamedCurve()
96 return encoded.clone(); in getEncoded()
/libcore/luni/src/test/java/libcore/java/security/cert/
DCertificateFactoryTest.java460 final byte[] encoded; in testCertPathEncoding()
462 encoded = pathFromList.getEncoded(); in testCertPathEncoding()
467 Arrays.toString(encoded)); in testCertPathEncoding()
469 encoded = pathFromList.getEncoded(encoding); in testCertPathEncoding()
474 Arrays.toString(encoded)); in testCertPathEncoding()
476 assertFalse(providerName, Arrays.toString(encoded).equals(Arrays.toString(encodedCopy))); in testCertPathEncoding()
479 assertEquals(providerName, Arrays.toString(encoded), Arrays.toString(encodedCopy)); in testCertPathEncoding()
483 actualPath = cf.generateCertPath(new ByteArrayInputStream(encoded)); in testCertPathEncoding()
485 actualPath = cf.generateCertPath(new ByteArrayInputStream(encoded), encoding); in testCertPathEncoding()
DSubjectAlternativeNameTest.java67 byte[] encoded = certificate.getEncoded(); in bouncycastleToJava()
69 return (X509Certificate) factory.generateCertificate(new ByteArrayInputStream(encoded)); in bouncycastleToJava()

12