public class

RFC822Name

extends Object
implements GeneralNameInterface
java.lang.Object
   ↳ sun.security.x509.RFC822Name

Class Overview

This class implements the RFC822Name as required by the GeneralNames ASN.1 object.

Summary

[Expand]
Inherited Constants
From interface sun.security.x509.GeneralNameInterface
Public Constructors
RFC822Name(DerValue derValue)
Create the RFC822Name object from the passed encoded Der value.
RFC822Name(String name)
Create the RFC822Name object with the specified name.
Public Methods
int constrains(GeneralNameInterface inputName)
Return constraint type:
  • NAME_DIFF_TYPE = -1: input name is different type from name (i.e.
void encode(DerOutputStream out)
Encode the RFC822 name into the DerOutputStream.
boolean equals(Object obj)
Compares this name with another, for equality.
String getName()
Return the actual name value of the GeneralName.
int getType()
Return the type of the GeneralName.
int hashCode()
Returns the hash code value for this object.
void parseName(String name)
Parse an RFC822Name string to see if it is a valid addr-spec according to IETF RFC822 and RFC2459: [local-part@]domain

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

int subtreeDepth()
Return subtree depth of this name for purposes of determining NameConstraints minimum and maximum bounds.
String toString()
Convert the name into user readable string.
[Expand]
Inherited Methods
From class java.lang.Object
From interface sun.security.x509.GeneralNameInterface

Public Constructors

public RFC822Name (DerValue derValue)

Create the RFC822Name object from the passed encoded Der value.

Parameters
derValue the encoded DER RFC822Name.
Throws
IOException on error.

public RFC822Name (String name)

Create the RFC822Name object with the specified name.

Parameters
name the RFC822Name.
Throws
IOException on invalid input name

Public Methods

public int constrains (GeneralNameInterface inputName)

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.

[RFC2459] When the subjectAltName extension contains an Internet mail address, the address MUST be included as an rfc822Name. The format of an rfc822Name is an "addr-spec" as defined in RFC 822 [RFC 822]. An addr-spec has the form "local-part@domain". Note that an addr-spec 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 ">". Note that while upper and lower case letters are allowed in an RFC 822 addr-spec, no significance is attached to the case.

Parameters
inputName to be checked for being constrained
Throws
UnsupportedOperationException if name is not exact match, but narrowing and widening are not supported for this name type.

public void encode (DerOutputStream out)

Encode the RFC822 name into the DerOutputStream.

Parameters
out the DER stream to encode the RFC822Name to.
Throws
IOException on encoding errors.

public boolean equals (Object obj)

Compares this name with another, for equality.

Parameters
obj the reference object with which to compare.
Returns
  • true iff the names are equivalent according to RFC2459.

public String getName ()

Return the actual name value of the GeneralName.

public int getType ()

Return the type of the GeneralName.

public int hashCode ()

Returns the hash code value for this object.

Returns
  • a hash code value for this object.

public void parseName (String name)

Parse an RFC822Name string to see if it is a valid addr-spec according to IETF RFC822 and RFC2459: [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 the RFC822Name string
Throws
IOException if name is not valid

public int subtreeDepth ()

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

Throws
UnsupportedOperationException if not supported for this name type

public String toString ()

Convert the name into user readable string.

Returns
  • a string representation of the object.