Home
last modified time | relevance | path

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

123

/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()
/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 = 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(encryptedData); in getKeySpec()
251 checkPKCS8Encoding(encoded); in getKeySpec()
[all …]
/libcore/luni/src/main/java/libcore/util/
DHexEncoding.java159 public static byte[] decode(String encoded) throws IllegalArgumentException { in decode() argument
160 return decode(encoded.toCharArray()); in decode()
177 public static byte[] decode(String encoded, boolean allowSingleChar) in decode() argument
179 return decode(encoded.toCharArray(), allowSingleChar); in decode()
194 public static byte[] decode(char[] encoded) throws IllegalArgumentException { in decode() argument
195 return decode(encoded, false); in decode()
212 public static byte[] decode(char[] encoded, boolean allowSingleChar) in decode() argument
214 int encodedLength = encoded.length; in decode()
224 result[resultOffset++] = (byte) toDigit(encoded, i); in decode()
234 result[resultOffset++] = (byte) ((toDigit(encoded, i) << 4) | toDigit(encoded, i + 1)); in decode()
/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()
/libcore/ojluni/src/main/java/java/security/
DKeyRep.java110 private byte[] encoded; field in KeyRep
130 String format, byte[] encoded) { in KeyRep() argument
133 format == null || encoded == null) { in KeyRep()
140 this.encoded = encoded.clone(); in KeyRep()
168 return new SecretKeySpec(encoded, algorithm); in readResolve()
171 return f.generatePublic(new X509EncodedKeySpec(encoded)); in readResolve()
174 return f.generatePrivate(new PKCS8EncodedKeySpec(encoded)); in readResolve()
DPKCS12Attribute.java47 private final byte[] encoded; field in PKCS12Attribute
97 this.encoded = encode(type, values); in PKCS12Attribute()
125 public PKCS12Attribute(byte[] encoded) { in PKCS12Attribute() argument
126 if (encoded == null) { in PKCS12Attribute()
129 this.encoded = encoded.clone(); in PKCS12Attribute()
132 parse(encoded); in PKCS12Attribute()
182 return encoded.clone(); in getEncoded()
202 return Arrays.equals(encoded, ((PKCS12Attribute) obj).encoded); in equals()
215 hashValue = h = Arrays.hashCode(encoded); in hashCode()
254 private void parse(byte[] encoded) throws IOException { in parse() argument
[all …]
/libcore/ojluni/src/test/java/net/URLEncoder/
DURLEncodeDecode.java55 String encoded; in testURLEncodeDecode() local
58 encoded = URLEncoder.encode(str); in testURLEncodeDecode()
61 encoded = URLEncoder.encode(str, enc); in testURLEncodeDecode()
63 Assert.assertEquals(encoded, correctEncodedUTF8); in testURLEncodeDecode()
68 decoded = URLDecoder.decode(encoded); in testURLEncodeDecode()
70 decoded = URLDecoder.decode(encoded, enc); in testURLEncodeDecode()
DSurrogatePairs.java79 String encoded = URLEncoder.encode(str, "UTF-8"); in test() local
81 Assert.assertEquals(encoded, correctEncoding); in test()
83 String decoded = URLDecoder.decode(encoded, "UTF-8"); in test()
DDecoder.java54 String encoded = URLEncoder.encode(strings[i], enc); in testDecoder() local
55 String decoded = URLDecoder.decode(encoded, enc); in testDecoder()
/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/test/java/util/Base64/
DTestBase64.java169 byte[] encoded = enc.encode(orig); in test()
170 byte[] decoded = dec.decode(encoded); in test()
175 if (encoded[encoded.length - 1] == '=') in test()
181 if (!Arrays.equals(str.getBytes("ASCII"), encoded)) { in test()
185 byte[] buf = dec.decode(new String(encoded, "ASCII")); in test()
189 testEncode(enc, ByteBuffer.wrap(orig), encoded); in test()
192 testEncode(enc, bin, encoded); in test()
194 testDecode(dec, ByteBuffer.wrap(encoded), orig); in test()
195 bin = ByteBuffer.allocateDirect(encoded.length); in test()
196 bin.put(encoded).flip(); in test()
[all …]
/libcore/luni/src/test/java/org/apache/harmony/security/tests/java/security/
DKeyFactoryTest.java197 assertTrue(Arrays.equals(key.encoded, publicKey.getEncoded())); in testGeneratePublic()
439 return new TestPrivateKey(((TestPrivateKeySpec)keySpec).encoded); in engineGeneratePrivate()
449 return new TestPublicKey(((TestPublicKeySpec)keySpec).encoded); in engineGeneratePublic()
512 private final byte[] encoded; field in KeyFactoryTest.TestPrivateKeySpec
515 this.encoded = key.getEncoded(); in TestPrivateKeySpec()
521 private final byte[] encoded; field in KeyFactoryTest.TestPublicKeySpec
524 this.encoded = key.getEncoded(); in TestPublicKeySpec()
530 private final byte[] encoded; field in KeyFactoryTest.TestPrivateKey
533 encoded = new byte[] {3, 4, 5}; in TestPrivateKey()
536 public TestPrivateKey(byte[] encoded) { in TestPrivateKey() argument
[all …]
/libcore/ojluni/src/test/java/net/URLDecoder/
DEncodingTest.java88 String encoded = URLEncoder.encode("http://www.xyz.com/find?key=\u0100\u0101", in testIllegalArgument() local
90 String illegal = "%" + encoded; in testIllegalArgument()
109 String encoded = URLEncoder.encode(s, StandardCharsets.UTF_8.name()); in decode() local
110 String returned1 = URLDecoder.decode(encoded, StandardCharsets.UTF_8.name()); in decode()
111 String returned2 = URLDecoder.decode(encoded, StandardCharsets.UTF_8); in decode()
/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/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/test/java/security/cert/
DCertPathEncodingTest.java245 byte[] encoded = cp.getEncoded("PKCS7"); in testCertPathEncoding()
247 assertEquals(Base64.getMimeDecoder().decode(pkcs7path.getBytes()), encoded, in testCertPathEncoding() local
252 CertPath decodedCP = certFac.generateCertPath(new ByteArrayInputStream(encoded), "PKCS7"); in testCertPathEncoding()
DX509CertSelectorTest.java244 byte[] encoded = in.getOctetString(); in testSubjectKeyIdentifier()
245 selector.setSubjectKeyIdentifier(encoded); in testSubjectKeyIdentifier()
265 byte[] encoded = in.getOctetString(); in testAuthorityKeyIdentifier()
266 selector.setAuthorityKeyIdentifier(encoded); in testAuthorityKeyIdentifier()
305 byte[] encoded = in.getOctetString(); in testPrivateKeyValid()
306 PrivateKeyUsageExtension ext = new PrivateKeyUsageExtension(false, encoded); in testPrivateKeyValid()
375 byte[] encoded = in.getOctetString(); in testSubjectAltName()
376 SubjectAlternativeNameExtension ext = new SubjectAlternativeNameExtension(false, encoded); in testSubjectAltName()
429 byte[] encoded = in.getOctetString(); in testPathToName()
430 NameConstraintsExtension ext = new NameConstraintsExtension(false, encoded); in testPathToName()
/libcore/luni/src/test/java/libcore/java/security/spec/
DAlgorithmParametersPSSTest.java106 byte[] encoded, PSSParameterSpec expected) throws Exception { in assertInitWithDerEncoded() argument
108 params.init(encoded); in assertInitWithDerEncoded()
112 params.init(encoded, "ASN.1"); in assertInitWithDerEncoded()
136 byte[] encoded = params.getEncoded("ASN.1"); in assertGetEncoded()
137 assertTrue(Arrays.equals(expectedEncoded, encoded)); in assertGetEncoded()
139 assertTrue(Arrays.equals(encoded, params.getEncoded())); in assertGetEncoded()
/libcore/ojluni/src/test/java/security/KeyAgreement/
DNegativeTest.java155 byte[] encoded = kp.getPrivate().getEncoded(); in testModifiedKeyEncodingTest()
156 byte[] modified = modifyEncoded(encoded); in testModifiedKeyEncodingTest()
165 encoded = kp.getPublic().getEncoded(); in testModifiedKeyEncodingTest()
166 modified = modifyEncoded(encoded); in testModifiedKeyEncodingTest()
356 private static byte[] modifyEncoded(byte[] encoded) { in modifyEncoded() argument
358 byte[] copy = Arrays.copyOf(encoded, encoded.length); in modifyEncoded()
/libcore/ojluni/annotations/hiddenapi/sun/security/provider/certpath/
DX509CertificatePair.java42 private X509CertificatePair(byte[] encoded) throws java.security.cert.CertificateException { in X509CertificatePair() argument
52 generateCertificatePair(byte[] encoded) throws java.security.cert.CertificateException { in generateCertificatePair() argument
108 private byte[] encoded; field in X509CertificatePair
/libcore/luni/src/main/java/android/crypto/hpke/
DXdhKeySpec.java36 public XdhKeySpec(@NonNull byte[] encoded) { in XdhKeySpec() argument
37 super(encoded); in XdhKeySpec()

123