public class ESSSecurityLabel
extends java.lang.Object
implements oracle.security.crypto.asn1.ASN1Object
A security label consists of a security policy identifier, and optionnaly of a security classification, a privacy mark and security categories.
| Modifier and Type | Field and Description |
|---|---|
static int |
CONFIDENTIAL
A security classification.
|
static int |
RESTRICTED
A security classification.
|
static int |
SECRET
A security classification.
|
static int |
TOP_SECRET
A security classification.
|
static int |
UB_INTEGER_OPTIONS
Maximum value of security classification.
|
static int |
UB_PRIVACY_MARK_LENGTH
Maximum length of the privacy mark.
|
static int |
UB_SECURITY_CATEGORIES
Maximum number of security categories.
|
static int |
UNCLASSIFIED
A security classification.
|
static int |
UNMARKED
A security classification.
|
| Constructor and Description |
|---|
ESSSecurityLabel(oracle.security.crypto.asn1.ASN1ObjectID securityPolicyID)
Creates a
ESSSecurityLabel with the given policy identifier. |
ESSSecurityLabel(oracle.security.crypto.asn1.ASN1ObjectID securityPolicyID, int secClass)
Creates a
ESSSecurityLabel with the given policy identifier and classification. |
ESSSecurityLabel(oracle.security.crypto.asn1.ASN1ObjectID securityPolicyID, int secClass, java.lang.String privMark, boolean useUTF8)
Creates a
ESSSecurityLabel with the given policy identifier and classification. |
ESSSecurityLabel(CMSSignerInfo si)
Creates a
ESSSecurityLabel from the CMSSignerInfo. |
ESSSecurityLabel(java.io.InputStream is)
Creates a
ESSSecurityLabel by reading the BER encoding from the given input stream. |
| Modifier and Type | Method and Description |
|---|---|
void |
addSecurityCategory(oracle.security.crypto.asn1.ASN1ObjectID type, oracle.security.crypto.asn1.ASN1Object value)
Adds a security category with the given type and value.
|
boolean |
equals(java.lang.Object o)
Indicates if the object equals the specified object.
|
java.lang.String |
getPrivacyMark()
Returns the Privacy Mark.
|
java.util.Hashtable |
getSecurityCategories()
Returns the list Security Categories.
|
int |
getSecurityClassification()
Returns the Security Classification value.
|
oracle.security.crypto.asn1.ASN1ObjectID |
getSecurityPolicyIdentifier()
Returns the Security Policy Identifier.
|
int |
hashCode()
Return the hash code for this object.
|
void |
input(java.io.InputStream is) |
boolean |
isUTF8StringPrivacyMark()
Indicates if the privacy mark is to be encoded as an UTF8String.
|
int |
length()
Returns the length of this object's encoding.
|
void |
output(java.io.OutputStream os)
Outputs this object's encoding to the specified output stream.
|
void |
setPrivacyMark(java.lang.String privacyMark, boolean useUTF8)
Sets the privacy mark of this security label.
|
void |
setSecurityClassification(int secClass)
Sets the security classification of this security label.
|
java.lang.String |
toString() |
public static final int UNMARKED
public static final int UNCLASSIFIED
public static final int RESTRICTED
public static final int CONFIDENTIAL
public static final int SECRET
public static final int TOP_SECRET
public static final int UB_INTEGER_OPTIONS
public static final int UB_PRIVACY_MARK_LENGTH
public static final int UB_SECURITY_CATEGORIES
public ESSSecurityLabel(java.io.InputStream is)
throws java.io.IOException
ESSSecurityLabel by reading the BER encoding from the given input stream.is - The input stream.java.io.IOException - If the input encoding is incorrect or an I/O error occurred.public ESSSecurityLabel(CMSSignerInfo si) throws oracle.security.crypto.util.InvalidInputException
ESSSecurityLabel from the CMSSignerInfo.si - The message signer (CMSSignerInfo).oracle.security.crypto.util.InvalidInputException - If the input is not correctly formatted.public ESSSecurityLabel(oracle.security.crypto.asn1.ASN1ObjectID securityPolicyID)
ESSSecurityLabel with the given policy identifier.securityPolicyID - The security policy identifier of this security label.public ESSSecurityLabel(oracle.security.crypto.asn1.ASN1ObjectID securityPolicyID,
int secClass)
throws oracle.security.crypto.util.InvalidInputException
ESSSecurityLabel with the given policy identifier and classification.securityPolicyID - The security policy identifier of this security label.secClass - The security classification of this security label.oracle.security.crypto.util.InvalidInputException - If the security classification value is invalid.public ESSSecurityLabel(oracle.security.crypto.asn1.ASN1ObjectID securityPolicyID,
int secClass,
java.lang.String privMark,
boolean useUTF8)
throws oracle.security.crypto.util.InvalidInputException
ESSSecurityLabel with the given policy identifier and classification.securityPolicyID - The security policy identifier of this security label.oracle.security.crypto.util.InvalidInputException - If the privacy mark is too long.public boolean equals(java.lang.Object o)
equals in class java.lang.Objecttrue this object is equal to the specified object; false otherwise.public int hashCode()
hashCode in class java.lang.Objectpublic void setSecurityClassification(int secClass)
throws oracle.security.crypto.util.InvalidInputException
secClass - The security classification of this security label.oracle.security.crypto.util.InvalidInputException - If the security classification is invalid.public void setPrivacyMark(java.lang.String privacyMark,
boolean useUTF8)
throws oracle.security.crypto.util.InvalidInputException
privMark - The privacy mark of this security label.useUTF8 - If true the privacy mark is encoded as an UTF8String; false otherwise.oracle.security.crypto.util.InvalidInputException - If the privacy mark is too long.public void addSecurityCategory(oracle.security.crypto.asn1.ASN1ObjectID type,
oracle.security.crypto.asn1.ASN1Object value)
throws oracle.security.crypto.util.InvalidInputException
type - The security category identifier.value - The security category value.oracle.security.crypto.util.InvalidInputException - If the maximum number of allowable security categories is exceeded.public oracle.security.crypto.asn1.ASN1ObjectID getSecurityPolicyIdentifier()
public int getSecurityClassification()
-1 otherwise.public java.lang.String getPrivacyMark()
null otherwise.public boolean isUTF8StringPrivacyMark()
This method is revelant only if the privacy mark is present.
public java.util.Hashtable getSecurityCategories()
Hashtable of security categories if present; null otherwise.public java.lang.String toString()
toString in class java.lang.Objectpublic void input(java.io.InputStream is)
throws java.io.IOException
input in interface oracle.security.crypto.util.Streamablejava.io.IOExceptionpublic void output(java.io.OutputStream os)
throws java.io.IOException
output in interface oracle.security.crypto.util.Streamableos - The output stream.java.io.IOException - An I/O error occurred.public int length()
length in interface oracle.security.crypto.util.Streamable