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

public Class RFC822Name

extends Object
implements GeneralNameInterface
Class Inheritance
All Implemented Interfaces
sun.security.x509.GeneralNameInterface, sun.security.util.DerEncoder
Imports
java.io.IOException, java.util.Locale, sun.security.util.*

This class implements the RFC822Name as required by the GeneralNames ASN.1 object.
Authors
Amit Kapoor, Hemma Prafullchandra
See Also
GeneralName, GeneralNames, GeneralNameInterface

Field Summary

Modifier and TypeField and Description
private final String

Constructor Summary

AccessConstructor and Description
public
RFC822Name(DerValue
the encoded DER RFC822Name.
derValue
)

Create the RFC822Name object from the passed encoded Der value.

public
RFC822Name(String
the RFC822Name.
name
)

Create the RFC822Name object with the specified name.

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

constraint type above
constrains
(GeneralNameInterface
to be checked for being constrained
inputName
)

Implements sun.security.x509.GeneralNameInterface.constrains.

Return constraint type:

  • NAME_DIFF_TYPE = -1: input name is different type from name (i.e. does not constrain)
  • NAME_MATCH = 0: input name matches name
  • NAME_NARROWS = 1: input name narrows name
  • NAME_WIDENS = 2: input name widens name
  • NAME_SAME_TYPE = 3: input name does not match or narrow name, but is same type
public void
encode(DerOutputStream
the DER stream to encode the RFC822Name to.
out
)

Implements sun.security.util.DerEncoder.encode.

Encode the RFC822 name into the DerOutputStream.

public boolean

Returns:

true iff the names are equivalent according to RFC 5280.
equals
(Object obj)

Overrides java.lang.Object.equals.

Compares this name with another, for equality.

public String
getName()

Return the actual name value of the GeneralName.

public int
getType()

Implements sun.security.x509.GeneralNameInterface.getType.

Return the type of the GeneralName.

public int

Returns:

the hash code value for this object
hashCode
()

Overrides java.lang.Object.hashCode.

Returns the hash code value for this object.

public void
parseName(String
the RFC822Name string
name
)

Parse an RFC822Name string to see if it is a valid addr-spec according to IETF RFC 822 and RFC 5280: [local-part@]domain

local-part@ could be empty for an RFC822Name NameConstraint, but the domain at least must be non-empty.

public int

Returns:

distance of name from root
subtreeDepth
()

Implements sun.security.x509.GeneralNameInterface.subtreeDepth.

Return subtree depth of this name for purposes of determining NameConstraints minimum and maximum bounds.

public String
toString()

Overrides java.lang.Object.toString.

Convert the name into user readable string.

Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAllwaitwaitwait

Field Detail

nameback to summary
private final String name

Constructor Detail

RFC822Nameback to summary
public RFC822Name(DerValue derValue) throws IOException

Create the RFC822Name object from the passed encoded Der value.

Parameters
derValue:DerValue

the encoded DER RFC822Name.

Annotations
@SuppressWarnings:this-escape
Exceptions
IOException:
on error.
RFC822Nameback to summary
public RFC822Name(String name) throws IOException

Create the RFC822Name object with the specified name.

Parameters
name:String

the RFC822Name.

Annotations
@SuppressWarnings:this-escape
Exceptions
IOException:
on invalid input name

Method Detail

constrainsback to summary
public int constrains(GeneralNameInterface inputName) throws UnsupportedOperationException

Implements sun.security.x509.GeneralNameInterface.constrains.

Return constraint type:

  • NAME_DIFF_TYPE = -1: input name is different type from name (i.e. does not constrain)
  • NAME_MATCH = 0: input name matches name
  • NAME_NARROWS = 1: input name narrows name
  • NAME_WIDENS = 2: input name widens name
  • NAME_SAME_TYPE = 3: input name does not match or narrow name, but is same type
. These results are used in checking NameConstraints during certification path verification.

[RFC 5280]: When the subjectAltName extension contains an Internet mail address, the address MUST be stored in the rfc822Name. The format of an rfc822Name is a "Mailbox" as defined in Section 4.1.2 of [RFC2821]. A Mailbox has the form "Local-part@Domain". Note that a Mailbox has no phrase (such as a common name) before it, has no comment (text surrounded in parentheses) after it, and is not surrounded by "<" and ">".

Parameters
inputName:GeneralNameInterface

to be checked for being constrained

Returns:int

constraint type above

Exceptions
UnsupportedOperationException:
if name is not exact match, but narrowing and widening are not supported for this name type.
encodeback to summary
public void encode(DerOutputStream out)

Implements sun.security.util.DerEncoder.encode.

Encode the RFC822 name into the DerOutputStream.

Parameters
out:DerOutputStream

the DER stream to encode the RFC822Name to.

Annotations
@Override
equalsback to summary
public boolean equals(Object obj)

Overrides java.lang.Object.equals.

Compares this name with another, for equality.

Returns:boolean

true iff the names are equivalent according to RFC 5280.

Annotations
@Override
getNameback to summary
public String getName()

Return the actual name value of the GeneralName.

getTypeback to summary
public int getType()

Implements sun.security.x509.GeneralNameInterface.getType.

Return the type of the GeneralName.

hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Returns the hash code value for this object.

Returns:int

the hash code value for this object

Annotations
@Override
parseNameback to summary
public void parseName(String name) throws IOException

Parse an RFC822Name string to see if it is a valid addr-spec according to IETF RFC 822 and RFC 5280: [local-part@]domain

local-part@ could be empty for an RFC822Name NameConstraint, but the domain at least must be non-empty. Case is not significant.

Parameters
name:String

the RFC822Name string

Exceptions
IOException:
if name is not valid
subtreeDepthback to summary
public int subtreeDepth() throws UnsupportedOperationException

Implements sun.security.x509.GeneralNameInterface.subtreeDepth.

Return subtree depth of this name for purposes of determining NameConstraints minimum and maximum bounds.

Returns:int

distance of name from root

Exceptions
UnsupportedOperationException:
if not supported for this name type
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Convert the name into user readable string.