APIdia Launch Partner
Top Description Fields Constructors Methods
sun.security.x509

public Class CertificateExtensions

extends Object
implements DerEncoder
Class Inheritance
All Implemented Interfaces
sun.security.util.DerEncoder
Imports
java.io.IOException, java.lang.reflect.Constructor, .InvocationTargetException, java.security.cert.CertificateException, java.util.*, sun.security.util.*

This class defines the Extensions attribute for the Certificate.
Authors
Amit Kapoor, Hemma Prafullchandra
See Also
DerEncoder

Field Summary

Modifier and TypeField and Description
private static final Debug
private final Map<String, Extension>
public static final String
private static final Class<?>[]
private Map<String, Extension>
private boolean

Constructor Summary

AccessConstructor and Description
public
CertificateExtensions()

Default constructor.

public
CertificateExtensions(DerInputStream
the DerInputStream to read the Extension from.
in
)

Create the object, decoding the values from the passed DER stream.

Method Summary

Modifier and TypeMethod and Description
public void
delete(String
the extension name used in the lookup.
name
)

Delete the extension value.

public void
encode(DerOutputStream
the DerOutputStream to marshal the contents to.
out
)

Implements sun.security.util.DerEncoder.encode.

Encode the extensions in DER form to the stream, setting the context specific tag as needed in the X.509 v3 certificate.

public void
encode(DerOutputStream
the DerOutputStream to marshal the contents to.
out
,
boolean
if true then no context specific tag is added.
isCertReq
)

Encode the extensions in DER form to the stream.

public boolean

Returns:

true iff all the entries match that of the Other, false otherwise.
equals
(Object
the object to test for equality with this CertificateExtensions.
other
)

Overrides java.lang.Object.equals.

Compares this CertificateExtensions for equality with the specified object.

public Collection<Extension>

Returns:

a collection view of the extensions in this Certificate.
getAllExtensions
()

Return a collection view of the extensions.

public Extension
getExtension(String
the identifier string for the extension to retrieve. Could be one of "x509.info.extensions.ExtensionName", "ExtensionName", "2.3.4.5".
alias
)

Get the extension with this alias.

public String
public Map<String, Extension>
public int

Returns:

a hashcode value for this CertificateExtensions
hashCode
()

Overrides java.lang.Object.hashCode.

Returns a hashcode value for this CertificateExtensions.

public boolean
hasUnsupportedCriticalExtension()

Return true if a critical extension is found that is not supported, otherwise return false.

private void
private void
public void
setExtension(String
the extension name used in the cache.
name
,
Extension
the extension to set.
ext
)

Set the extension value.

public String

Returns:

a string representation of this CertificateExtensions.
toString
()

Overrides java.lang.Object.toString.

Returns a string representation of this CertificateExtensions object in the form of a set of entries, enclosed in braces and separated by the ASCII characters ", " (comma and space).

Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAllwaitwaitwait

Field Detail

debugback to summary
private static final Debug debug
mapback to summary
private final Map<String, Extension> map
NAMEback to summary
public static final String NAME
PARAMSback to summary
private static final Class<?>[] PARAMS
unparseableExtensionsback to summary
private Map<String, Extension> unparseableExtensions
unsupportedCritExtback to summary
private boolean unsupportedCritExt

Constructor Detail

CertificateExtensionsback to summary
public CertificateExtensions()

Default constructor.

CertificateExtensionsback to summary
public CertificateExtensions(DerInputStream in) throws IOException

Create the object, decoding the values from the passed DER stream.

Parameters
in:DerInputStream

the DerInputStream to read the Extension from.

Exceptions
IOException:
on decoding errors.

Method Detail

deleteback to summary
public void delete(String name) throws IOException

Delete the extension value.

Parameters
name:String

the extension name used in the lookup.

Exceptions
IOException:
if named extension is not found.
encodeback to summary
public void encode(DerOutputStream out)

Implements sun.security.util.DerEncoder.encode.

Encode the extensions in DER form to the stream, setting the context specific tag as needed in the X.509 v3 certificate.

Parameters
out:DerOutputStream

the DerOutputStream to marshal the contents to.

Annotations
@Override
encodeback to summary
public void encode(DerOutputStream out, boolean isCertReq)

Encode the extensions in DER form to the stream.

Parameters
out:DerOutputStream

the DerOutputStream to marshal the contents to.

isCertReq:boolean

if true then no context specific tag is added.

equalsback to summary
public boolean equals(Object other)

Overrides java.lang.Object.equals.

Compares this CertificateExtensions for equality with the specified object. If the other object is an instanceof CertificateExtensions, then all the entries are compared with the entries from this.

Parameters
other:Object

the object to test for equality with this CertificateExtensions.

Returns:boolean

true iff all the entries match that of the Other, false otherwise.

Annotations
@Override
getAllExtensionsback to summary
public Collection<Extension> getAllExtensions()

Return a collection view of the extensions.

Returns:Collection<Extension>

a collection view of the extensions in this Certificate.

getExtensionback to summary
public Extension getExtension(String alias)

Get the extension with this alias.

Parameters
alias:String

the identifier string for the extension to retrieve. Could be one of "x509.info.extensions.ExtensionName", "ExtensionName", "2.3.4.5".

getNameByOidback to summary
public String getNameByOid(ObjectIdentifier oid)
getUnparseableExtensionsback to summary
public Map<String, Extension> getUnparseableExtensions()
hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Returns a hashcode value for this CertificateExtensions.

Returns:int

a hashcode value for this CertificateExtensions

Annotations
@Override
hasUnsupportedCriticalExtensionback to summary
public boolean hasUnsupportedCriticalExtension()

Return true if a critical extension is found that is not supported, otherwise return false.

initback to summary
private void init(DerInputStream in) throws IOException
parseExtensionback to summary
private void parseExtension(Extension ext) throws IOException
setExtensionback to summary
public void setExtension(String name, Extension ext)

Set the extension value.

Parameters
name:String

the extension name used in the cache.

ext:Extension

the extension to set.

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Returns a string representation of this CertificateExtensions object in the form of a set of entries, enclosed in braces and separated by the ASCII characters ", " (comma and space).

Overrides to toString method of Object.

Returns:String

a string representation of this CertificateExtensions.