|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.util.AbstractCollection java.util.AbstractList java.util.ArrayList codec.asn1.ASN1AbstractCollection codec.asn1.ASN1Sequence codec.pkcs7.EnvelopedData de.fhg.igd.atlas.lsp.LSPRegisterEncrypted
Represents an LSP_RegisterEncrypted structure of the Location Service
Protocol (LSP).
Encapsulated in a LSPRequest
it is sent
to the Location Service Server
(LSServer
) to initialize,
update or delete an entry. If successful, the LSPReply
message has the result state ACKNOWLEDGE
. This class is
normally used by the Location Sevice Client
(LSClient
) to send an
encrypted register messages to initialize a new entry.
The ASN.1 structure of this request is as follows
The implicit name is the unique identifier of an mobile object for instance the hashcode of its static part. The contact address should consist of a URL string that specifies the protocol, address, and port of a management service provided by the server, which is in possession of the specified object. The current cookie is used as authorisation mechanism by the LS-Server and LS-Proxy permitting aLSP_RegisterEncrypted ::= EnvelopedDate LSP_RegisterPlain ::= SEQUENCE { implicitName ImplicitName, contactaddress ContactAddress, newCookie Cookie, currentCookie Cookie } ImplicitName ::= OCTET STRING ContactAddress ::= OCTET STRING Cookie ::= OCTET STRING
LSClient
to update or delete an existing entry. The new
cookie represents the authorisation code for the next registration.
To distinguish between initialization, update and deletion a special
NULL_COOKIE
is used as follows:
if (currentCookie == NULL_COOKIE)
{ Initialize a new entry }
if (newCookie == NULL_COOKIE)
{ Delete the existing entry }otherwise update the existing entry
LSPRegisterPlain
,
LSPRequest
,
LSPReply
,
Serialized FormNested Class Summary |
Nested classes inherited from class java.util.AbstractList |
|
Field Summary | |
protected LSPRegisterPlain |
registerPlain_
The plain register request as LSP_RegisterPlain |
Fields inherited from class codec.pkcs7.EnvelopedData |
BUFFER_SIZE, content_, info_, recipients_, version_ |
Fields inherited from class codec.asn1.ASN1AbstractCollection |
|
Fields inherited from class java.util.ArrayList |
|
Fields inherited from class java.util.AbstractList |
modCount |
Constructor Summary | |
LSPRegisterEncrypted()
Creates an instance ready for decoding. |
|
LSPRegisterEncrypted(byte[] implicitName,
URL contactAddress,
byte[] newCookie,
byte[] currentCookie,
SecretKey bek,
String bea,
AlgorithmParameters params,
X509Certificate recipient)
Creates an instance with the given parameters implicit name, contact address, new cookie and current cookie. |
|
LSPRegisterEncrypted(LSPRegisterPlain registerPlain,
SecretKey bek,
String bea,
AlgorithmParameters params,
X509Certificate recipient)
Creates an instance with the parameters of the given LSPRegisterPlain request. |
Method Summary | |
static LSPRegisterEncrypted |
createRequest(byte[] code)
Creates a new request from the given encoded request. |
URL |
getContactAddress()
Returns the contact address, if available in plaintext, an empty URL, if the encoded contact address is not well-formed, null otherwise. |
byte[] |
getCurrentCookie()
Returns the current cookie, if available in plaintext, null otherwise. |
byte[] |
getEncoded()
Returns the DER encoded encrypted request. |
byte[] |
getImplicitName()
Returns the implicit name, if available in plaintext, null otherwise. |
byte[] |
getNewCookie()
Returns the new cookie, if available in plaintext, null otherwise. |
LSPRegisterPlain |
getRegisterPlain()
Returns the parameters of this request as LSPRegisterPlain structure,
if available in plaintext, null otherwise. |
void |
runDecryption(X509Certificate cert,
PrivateKey key)
Decrypts a received request which has been decoded successfully by createRequest . |
protected void |
runEncryption()
Encrypts the given register request. |
String |
toString()
Returns the string representation of this request as LSPPlainRegister structure, if available
in plaintext, an errormessage, otherwise. |
Methods inherited from class codec.pkcs7.EnvelopedData |
addRecipient, decryptBulkData, encryptBulkData, getContentType, getData, getOID, getRecipientInfo, getRecipientInfos, getSecretKey, hasRecipient, init, isReady, setData |
Methods inherited from class codec.asn1.ASN1Sequence |
getTag |
Methods inherited from class codec.asn1.ASN1AbstractCollection |
checkConstraints, decode, encode, getCollection, getConstraint, getTagClass, getValue, isExplicit, isOptional, isType, setConstraint, setExplicit, setOptional |
Methods inherited from class java.util.ArrayList |
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, removeRange, set, size, toArray, toArray, trimToSize |
Methods inherited from class java.util.AbstractList |
equals, hashCode, iterator, listIterator, listIterator, subList |
Methods inherited from class java.util.AbstractCollection |
containsAll, remove, removeAll, retainAll |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface codec.asn1.ASN1Type |
checkConstraints, decode, encode, getConstraint, getTag, getTagClass, getValue, isExplicit, isOptional, isType, setConstraint, setExplicit, setOptional |
Methods inherited from interface java.util.Collection |
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray |
Methods inherited from interface java.util.List |
containsAll, equals, hashCode, iterator, listIterator, listIterator, remove, removeAll, retainAll, subList |
Field Detail |
protected LSPRegisterPlain registerPlain_
Constructor Detail |
public LSPRegisterEncrypted()
public LSPRegisterEncrypted(byte[] implicitName, URL contactAddress, byte[] newCookie, byte[] currentCookie, SecretKey bek, String bea, AlgorithmParameters params, X509Certificate recipient) throws GeneralSecurityException, BadNameException
runEncryption
.
implicitName
- The implicit name.contactAddress
- The contact address.newCookie
- The new cookie.currentCookie
- The current cookiebek
- The secret key to use for bulk encryption.bea
- The name of the bulk encryption algorithm.params
- The algorithm parameters of the bulk
encryption algorithm.recipient
- The certificate of the recipient.
GeneralSecurityException
- if some cipher
operation fails. The reason can be determined
from the actual subclass that is thrown.
BadNameException
- if the issuer name in
the certificate cannot be parsed.public LSPRegisterEncrypted(LSPRegisterPlain registerPlain, SecretKey bek, String bea, AlgorithmParameters params, X509Certificate recipient) throws GeneralSecurityException, BadNameException
LSPRegisterPlain
request.
The class is initialized for encryption with
the specified secret key, encryption algorithm,
and algoritm parameters.
The recipient specifies the receiver, who will
be able to decrypt the message.
The request is still plaintext. To encrypt call
runEncryption
.
registerPlain
- The LSPRegisterPlain
structure.bek
- The secret key to use for bulk encryption.bea
- The name of the bulk encryption algorithm.params
- The algorithm parameters of the bulk
encryption algorithm.recipient
- The certificate of the recipient.
GeneralSecurityException
- if some cipher
operation fails. The reason can bedetermined
from the actual subclass that is thrown.
BadNameException
- if the issuer name in
the certificate cannot be parsed.Method Detail |
public static LSPRegisterEncrypted createRequest(byte[] code) throws CorruptedCodeException, IllegalStateException, NullPointerException
runDecryption
code
- The encoded request.
CorruptedCodeException
- if the code is bad.
IllegalStateException
- if an error occurs while
decoding with DERDecoder
(RuntimeException).
NullPointerException
- if code
is null
(RuntimeException).protected void runEncryption() throws GeneralSecurityException
GeneralSecurityException
- if an error occurs
while encrypting such as algorithms not found,
bad paddings et cetera.public void runDecryption(X509Certificate cert, PrivateKey key) throws GeneralSecurityException, CorruptedCodeException
createRequest
. The plain
request parameters should be available then.
cert
- The certificate matching the private key
of the recipient.key
- The private Key Decryption Key required
to decrypt the request.
GeneralSecurityException
- if a cipher operation fails.
CorruptedCodeException
- if the decrypted code is bad or
the certificate of recipient is not valid.public LSPRegisterPlain getRegisterPlain()
LSPRegisterPlain
structure,
if available in plaintext, null
otherwise.
LSPRegisterPlain
structurepublic byte[] getImplicitName()
null
otherwise.
getImplicitName
in interface LSPRegister
public URL getContactAddress()
null
otherwise.
getContactAddress
in interface LSPRegister
public byte[] getNewCookie()
null
otherwise.
getNewCookie
in interface LSPRegister
public byte[] getCurrentCookie()
null
otherwise.
getCurrentCookie
in interface LSPRegister
public byte[] getEncoded() throws IllegalStateException
runEncryption
has been called before.
IllegalStateException
- if an exception occures
during ASN1 encoding (RuntimeException).public String toString()
LSPPlainRegister
structure, if available
in plaintext, an errormessage, otherwise.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |