Skip to content

Commit 27527b4

Browse files
committed
8296612: CertAttrSet is useless
Reviewed-by: mullan
1 parent 6b456f7 commit 27527b4

File tree

52 files changed

+80
-203
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+80
-203
lines changed

src/java.base/share/classes/com/sun/crypto/provider/OAEPParameters.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ protected byte[] engineGetEncoded() throws IOException {
180180
" impl not found");
181181
}
182182
tmp2 = new DerOutputStream();
183-
mdAlgId.derEncode(tmp2);
183+
mdAlgId.encode(tmp2);
184184
tmp.write(DerValue.createTag(DerValue.TAG_CONTEXT, true, (byte)0),
185185
tmp2);
186186

src/java.base/share/classes/sun/security/pkcs/PKCS7.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -782,9 +782,9 @@ public static byte[] generateNewSignedData(
782782
// CMSAlgorithmProtection (RFC6211)
783783
DerOutputStream derAp = new DerOutputStream();
784784
DerOutputStream derAlgs = new DerOutputStream();
785-
digAlgID.derEncode(derAlgs);
785+
digAlgID.encode(derAlgs);
786786
DerOutputStream derSigAlg = new DerOutputStream();
787-
sigAlgID.derEncode(derSigAlg);
787+
sigAlgID.encode(derSigAlg);
788788
derAlgs.writeImplicit((byte)0xA1, derSigAlg);
789789
derAp.write(DerValue.tag_Sequence, derAlgs);
790790
authAttrs = new PKCS9Attributes(new PKCS9Attribute[]{

src/java.base/share/classes/sun/security/pkcs/PKCS9Attribute.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,7 @@ public PKCS9Attribute(DerValue derVal) throws IOException {
524524
* should be encoded as <code>T61String</code>s.
525525
*/
526526
@Override
527-
public void derEncode(DerOutputStream out) throws IOException {
527+
public void encode(DerOutputStream out) throws IOException {
528528
DerOutputStream temp = new DerOutputStream();
529529
temp.putOID(oid);
530530
switch (index) {

src/java.base/share/classes/sun/security/pkcs/SignerInfo.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -208,11 +208,6 @@ private void checkCMSAlgorithmProtection() throws IOException {
208208
}
209209
}
210210

211-
public void encode(DerOutputStream out) throws IOException {
212-
213-
derEncode(out);
214-
}
215-
216211
/**
217212
* DER encode this object onto an output stream.
218213
* Implements the {@code DerEncoder} interface.
@@ -222,7 +217,8 @@ public void encode(DerOutputStream out) throws IOException {
222217
*
223218
* @exception IOException on encoding error.
224219
*/
225-
public void derEncode(DerOutputStream out) throws IOException {
220+
@Override
221+
public void encode(DerOutputStream out) throws IOException {
226222
DerOutputStream seq = new DerOutputStream();
227223
seq.putInteger(version);
228224
DerOutputStream issuerAndSerialNumber = new DerOutputStream();

src/java.base/share/classes/sun/security/pkcs10/PKCS10Attribute.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,10 @@ public PKCS10Attribute(PKCS9Attribute attr) {
107107
*
108108
* @exception IOException on encoding errors.
109109
*/
110-
public void derEncode(DerOutputStream out) throws IOException {
110+
@Override
111+
public void encode(DerOutputStream out) throws IOException {
111112
PKCS9Attribute attr = new PKCS9Attribute(attributeId, attributeValue);
112-
attr.derEncode(out);
113+
attr.encode(out);
113114
}
114115

115116
/**

src/java.base/share/classes/sun/security/pkcs10/PKCS10Attributes.java

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -87,24 +87,15 @@ public PKCS10Attributes(DerInputStream in) throws IOException {
8787
}
8888
}
8989

90-
/**
91-
* Encode the attributes in DER form to the stream.
92-
*
93-
* @param out the OutputStream to marshal the contents to.
94-
* @exception IOException on encoding errors.
95-
*/
96-
public void encode(DerOutputStream out) throws IOException {
97-
derEncode(out);
98-
}
99-
10090
/**
10191
* Encode the attributes in DER form to the stream.
10292
* Implements the {@code DerEncoder} interface.
10393
*
10494
* @param out the OutputStream to marshal the contents to.
10595
* @exception IOException on encoding errors.
10696
*/
107-
public void derEncode(DerOutputStream out) throws IOException {
97+
@Override
98+
public void encode(DerOutputStream out) throws IOException {
10899
// first copy the elements into an array
109100
Collection<PKCS10Attribute> allAttrs = map.values();
110101
PKCS10Attribute[] attribs =

src/java.base/share/classes/sun/security/rsa/PSSParameters.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ public static byte[] getEncoded(PSSParameterSpec spec) throws IOException {
239239
}
240240
if (!mdAlgId.getOID().equals(AlgorithmId.SHA_oid)) {
241241
tmp2 = new DerOutputStream();
242-
mdAlgId.derEncode(tmp2);
242+
mdAlgId.encode(tmp2);
243243
tmp.write(DerValue.createTag(DerValue.TAG_CONTEXT, true, (byte) 0),
244244
tmp2);
245245
}

src/java.base/share/classes/sun/security/util/DerEncoder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public interface DerEncoder {
4040
*
4141
* @param out the stream on which the DER encoding is written.
4242
*/
43-
void derEncode(DerOutputStream out)
43+
void encode(DerOutputStream out)
4444
throws IOException;
4545

4646
}

src/java.base/share/classes/sun/security/util/DerOutputStream.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ private DerOutputStream putOrderedSet(byte tag, DerEncoder[] set,
404404

405405
for (int i = 0; i < set.length; i++) {
406406
streams[i] = new DerOutputStream();
407-
set[i].derEncode(streams[i]);
407+
set[i].encode(streams[i]);
408408
}
409409

410410
// order the element encodings
@@ -582,7 +582,8 @@ public void putLength(int len) throws IOException {
582582
*
583583
* @exception IOException on output error.
584584
*/
585-
public void derEncode(DerOutputStream out) throws IOException {
585+
@Override
586+
public void encode(DerOutputStream out) throws IOException {
586587
out.write(toByteArray());
587588
}
588589

@@ -592,7 +593,7 @@ public void derEncode(DerOutputStream out) throws IOException {
592593
* @throws IOException on output error
593594
*/
594595
public DerOutputStream write(DerEncoder encoder) throws IOException {
595-
encoder.derEncode(this);
596+
encoder.encode(this);
596597
return this;
597598
}
598599

src/java.base/share/classes/sun/security/x509/AVA.java

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -616,13 +616,6 @@ public int hashCode() {
616616
return toRFC2253CanonicalString().hashCode();
617617
}
618618

619-
/*
620-
* AVAs are encoded as a SEQUENCE of two elements.
621-
*/
622-
public void encode(DerOutputStream out) throws IOException {
623-
derEncode(out);
624-
}
625-
626619
/**
627620
* DER encode this object onto an output stream.
628621
* Implements the <code>DerEncoder</code> interface.
@@ -632,7 +625,8 @@ public void encode(DerOutputStream out) throws IOException {
632625
*
633626
* @exception IOException on encoding error.
634627
*/
635-
public void derEncode(DerOutputStream out) throws IOException {
628+
@Override
629+
public void encode(DerOutputStream out) throws IOException {
636630
DerOutputStream tmp = new DerOutputStream();
637631

638632
tmp.putOID(oid);

0 commit comments

Comments
 (0)