org.mozilla.jss.pkix.crmf

Class EncryptedKey

Implemented Interfaces:
ASN1Value

public class EncryptedKey
extends java.lang.Object
implements ASN1Value

Nested Class Summary

static class
EncryptedKey.Template
A Template for decoding BER-encoded EncryptedKeys.
static class
EncryptedKey.Type
The type of EncryptedKey.

Field Summary

static EncryptedKey.Type
ENCRYPTED_VALUE
static EncryptedKey.Type
ENVELOPED_DATA

Constructor Summary

EncryptedKey(ANY envelopedData)
EncryptedKey(EncryptedValue encryptedValue)

Method Summary

void
encode(OutputStream ostream)
Write this value's DER encoding to an output stream using its own base tag.
void
encode(Tag implicitTag, OutputStream ostream)
Write this value's DER encoding to an output stream using an implicit tag.
EncryptedValue
getEncryptedValue()
Should only be called if getType returns ENCRYPTED_VALUE.
ANY
getEnvelopedData()
Should only be called if getType returns ENVELOPED_DATA.
Tag
getTag()
Returns the base tag for this type, not counting any tags that may be imposed on it by its context.
static EncryptedKey.Template
getTemplate()
EncryptedKey.Type
getType()

Field Details

ENCRYPTED_VALUE

public static final EncryptedKey.Type ENCRYPTED_VALUE

ENVELOPED_DATA

public static final EncryptedKey.Type ENVELOPED_DATA

Constructor Details

EncryptedKey

public EncryptedKey(ANY envelopedData)

EncryptedKey

public EncryptedKey(EncryptedValue encryptedValue)

Method Details

encode

public void encode(OutputStream ostream)
            throws IOException
Write this value's DER encoding to an output stream using its own base tag.
Specified by:
encode in interface ASN1Value

encode

public void encode(Tag implicitTag,
                   OutputStream ostream)
            throws IOException
Write this value's DER encoding to an output stream using an implicit tag.
Specified by:
encode in interface ASN1Value

getEncryptedValue

public EncryptedValue getEncryptedValue()
Should only be called if getType returns ENCRYPTED_VALUE.

getEnvelopedData

public ANY getEnvelopedData()
Should only be called if getType returns ENVELOPED_DATA. ANY is returned to prevent a circular dependency between the org.mozilla.jss.pkcs7 package and the org.mozilla.jss.pkix hierarchy.

getTag

public Tag getTag()
Returns the base tag for this type, not counting any tags that may be imposed on it by its context.
Specified by:
getTag in interface ASN1Value

getTemplate

public static EncryptedKey.Template getTemplate()

getType

public EncryptedKey.Type getType()