|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.prosysopc.ua.SecureIdentity
public class SecureIdentity
| Field Summary | |
|---|---|
protected org.opcfoundation.ua.transport.security.Cert |
certificate
|
protected org.opcfoundation.ua.transport.security.PrivKey |
privateKey
|
| Constructor Summary | |
|---|---|
protected |
SecureIdentity()
|
|
SecureIdentity(org.opcfoundation.ua.transport.security.Cert certificate,
org.opcfoundation.ua.transport.security.PrivKey privateKey)
Create a new identity |
|
SecureIdentity(File certificateFile,
File privateKeyFile,
String privateKeyPassword)
Create a new identity by loading the certificate and private key from files. |
|
SecureIdentity(File storeLocation,
String alias,
String privateKeyPassword,
String keyStorePassword,
String keyStoreType)
Creates a new SecureIdentity object from a pfx-keystore file. |
|
SecureIdentity(URL certificateFile,
URL privateKeyFile,
String privateKeyPassword)
Create a new identity by loading the certificate and private key from files. |
| Method Summary | |
|---|---|
protected byte[] |
decrypt(org.opcfoundation.ua.transport.security.SecurityAlgorithm algorithm,
byte[] dataToDecrypt,
org.opcfoundation.ua.transport.security.PrivKey privKey)
Decrypt data using the provided securityPolicy. |
byte[] |
decrypt(org.opcfoundation.ua.transport.security.SecurityPolicy securityPolicy,
byte[] dataToDecrypt)
Decrypt data using the provided securityPolicy. |
byte[] |
encrypt(org.opcfoundation.ua.transport.security.SecurityPolicy securityPolicy,
byte[] dataToEncrypt)
Encrypt data using the provided securityPolicy. |
boolean |
equals(Object obj)
|
org.opcfoundation.ua.transport.security.Cert |
getCertificate()
|
org.opcfoundation.ua.transport.security.KeyPair |
getKeys()
|
org.opcfoundation.ua.transport.security.PrivKey |
getPrivateKey()
|
int |
hashCode()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected org.opcfoundation.ua.transport.security.Cert certificate
protected final org.opcfoundation.ua.transport.security.PrivKey privateKey
| Constructor Detail |
|---|
public SecureIdentity(org.opcfoundation.ua.transport.security.Cert certificate,
org.opcfoundation.ua.transport.security.PrivKey privateKey)
certificate - The public key certificateprivateKey - The private key (optional)
public SecureIdentity(File certificateFile,
File privateKeyFile,
String privateKeyPassword)
throws IOException,
SecureIdentityException
certificateFile - The certificate file.privateKeyFile - The private key file.privateKeyPassword - The password protecting the private key.
IOException - If the files are not valid.
SecureIdentityException - if the certificate or private key file is not valid
public SecureIdentity(File storeLocation,
String alias,
String privateKeyPassword,
String keyStorePassword,
String keyStoreType)
throws IOException,
SecureIdentityException
storeLocation - location of the pfx-filealias - string alias of the key pair, if null or not found in specified pfx-file, last
entry is usedprivateKeyPassword - password of the private keykeyStorePassword - password of the keystorekeyStoreType - type of the key store, "JKS" and "PKCS12" supported
KeyStoreException - if the keystore has not been initialized (loaded)
NoSuchProviderException - if the specified provider (Bouncy Castle) is not registered in
the security provider list
NoSuchAlgorithmException - if the algorithm used to check the integrity of the keystore
cannot be found
CertificateException - if any of the certificates in the keystore could not be loaded
IOException
UnrecoverableKeyException - if a key in the keystore cannot be recovered
SecureIdentityException
public SecureIdentity(URL certificateFile,
URL privateKeyFile,
String privateKeyPassword)
throws IOException,
SecureIdentityException
certificateFile - The certificate file.privateKeyFile - The private key file.privateKeyPassword - The password protecting the private key.
IOException - If the files are not valid.
SecureIdentityException - if the certificate or private key file is not validprotected SecureIdentity()
| Method Detail |
|---|
public byte[] decrypt(org.opcfoundation.ua.transport.security.SecurityPolicy securityPolicy,
byte[] dataToDecrypt)
throws SecureIdentityException
securityPolicy - the security policy to use for the encryption.dataToDecrypt - data to decrypt
SecureIdentityException - if the decryption fails
public byte[] encrypt(org.opcfoundation.ua.transport.security.SecurityPolicy securityPolicy,
byte[] dataToEncrypt)
throws SecureIdentityException
securityPolicy - the security policy to use for the encryption.dataToEncrypt - data to encrypt
SecureIdentityException - if the encryption failspublic boolean equals(Object obj)
equals in class Objectpublic org.opcfoundation.ua.transport.security.Cert getCertificate()
public org.opcfoundation.ua.transport.security.KeyPair getKeys()
public org.opcfoundation.ua.transport.security.PrivKey getPrivateKey()
public int hashCode()
hashCode in class Object
protected byte[] decrypt(org.opcfoundation.ua.transport.security.SecurityAlgorithm algorithm,
byte[] dataToDecrypt,
org.opcfoundation.ua.transport.security.PrivKey privKey)
throws SecureIdentityException
algorithm - the security policy to use for the encryption.dataToDecrypt - data to decryptprivKey - the private key to use
SecureIdentityException - if the decryption fails
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||