org.n52.security.common.crypto
Class DefaultKeyPair

java.lang.Object
  extended by org.n52.security.common.crypto.DefaultKeyPair
All Implemented Interfaces:
Serializable, KeyPair

public class DefaultKeyPair
extends Object
implements KeyPair, Serializable

A bean (vo) style implementation of a KeyPair and can be used by different KeyPairProviders.

Version:
$Revision: $
Author:
Marko Reiprecht Created on 18.07.2008
See Also:
Serialized Form

Constructor Summary
DefaultKeyPair()
           
 
Method Summary
 String getAlias()
          Method gets the alias for the keypair.
 Certificate getCertificate()
          Method gets the certificate if one exists.
 Certificate[] getCertificateChain()
          Method gets the CertificateChain.
 Key getPrivateKey()
          Method gets the privateKey.
 PublicKey getPublicKey()
          Method gets the publicKey.
 boolean isCertificateChainSet()
          Returns if the pair bean contains a certificate chain.
 boolean isCertificateSet()
          Returns if the pair bean contains a certificate.
 boolean isPrivateKeySet()
          Returns if the pair bean contains a private key.
 boolean isPublicKeySet()
          Returns if the pair bean contains a public key.
 void setAlias(String alias)
           
 void setCertificate(Certificate certificate)
           
 void setCertificateChain(Certificate[] certificateChain)
           
 void setPrivateKey(Key privateKey)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultKeyPair

public DefaultKeyPair()
Method Detail

getAlias

public String getAlias()
Description copied from interface: KeyPair
Method gets the alias for the keypair. Can be the empty string if unused.

Specified by:
getAlias in interface KeyPair
Returns:
String.

setAlias

public void setAlias(String alias)

getCertificate

public Certificate getCertificate()
Description copied from interface: KeyPair
Method gets the certificate if one exists.

Specified by:
getCertificate in interface KeyPair
Returns:
X509Certificate or null.

setCertificate

public void setCertificate(Certificate certificate)

getCertificateChain

public Certificate[] getCertificateChain()
Description copied from interface: KeyPair
Method gets the CertificateChain.

Specified by:
getCertificateChain in interface KeyPair
Returns:
Certificate[].

setCertificateChain

public void setCertificateChain(Certificate[] certificateChain)

getPrivateKey

public Key getPrivateKey()
Description copied from interface: KeyPair
Method gets the privateKey. This can be a PrivateKey or a SecretKey

Specified by:
getPrivateKey in interface KeyPair
Returns:
Key.

setPrivateKey

public void setPrivateKey(Key privateKey)

getPublicKey

public PublicKey getPublicKey()
Description copied from interface: KeyPair
Method gets the publicKey.

if a X509Certificate exists than this method shall return getCertificate().getPublicKey();

Specified by:
getPublicKey in interface KeyPair
Returns:
PublicKey.

isCertificateChainSet

public boolean isCertificateChainSet()
Description copied from interface: KeyPair
Returns if the pair bean contains a certificate chain.

Specified by:
isCertificateChainSet in interface KeyPair
Returns:
boolean.

isCertificateSet

public boolean isCertificateSet()
Description copied from interface: KeyPair
Returns if the pair bean contains a certificate.

Specified by:
isCertificateSet in interface KeyPair
Returns:
boolean.

isPrivateKeySet

public boolean isPrivateKeySet()
Description copied from interface: KeyPair
Returns if the pair bean contains a private key.

Specified by:
isPrivateKeySet in interface KeyPair
Returns:
boolean.

isPublicKeySet

public boolean isPublicKeySet()
Description copied from interface: KeyPair
Returns if the pair bean contains a public key.

Specified by:
isPublicKeySet in interface KeyPair
Returns:
boolean.


Copyright © 2004–2014 52north.org. All rights reserved.