8296142: CertAttrSet::(getName|getElements|delete) are mostly useless

Reviewed-by: mullan
This commit is contained in:
Weijun Wang 2022-11-02 14:40:47 +00:00
parent 6626a29a74
commit 16a041a67a
41 changed files with 60 additions and 1162 deletions

View file

@ -28,7 +28,6 @@ package sun.security.x509;
import java.io.IOException;
import java.security.cert.CertificateException;
import java.security.cert.X509Certificate;
import java.util.*;
import javax.security.auth.x500.X500Principal;
@ -282,36 +281,12 @@ implements CertAttrSet<String>, Cloneable {
}
}
/**
* Delete the attribute value.
*/
public void delete(String name) throws IOException {
if (name.equalsIgnoreCase(PERMITTED_SUBTREES)) {
permitted = null;
} else if (name.equalsIgnoreCase(EXCLUDED_SUBTREES)) {
excluded = null;
} else {
throw new IOException("Attribute name not recognized by " +
"CertAttrSet:NameConstraintsExtension.");
}
encodeThis();
}
/**
* Return an enumeration of names of attributes existing within this
* attribute.
*/
public Enumeration<String> getElements() {
AttributeNameEnumeration elements = new AttributeNameEnumeration();
elements.addElement(PERMITTED_SUBTREES);
elements.addElement(EXCLUDED_SUBTREES);
return (elements.elements());
}
/**
* Return the name of this attribute.
*/
@Override
public String getName() {
return (NAME);
}