Project JXTA

net.jxta.impl.protocol
Class PSEConfigAdv

java.lang.Object
  extended by net.jxta.document.Advertisement
      extended by net.jxta.document.ExtendableAdvertisement
          extended by net.jxta.impl.protocol.PSEConfigAdv

public final class PSEConfigAdv
extends ExtendableAdvertisement

Contains parameters for configuration of the PSE Membership service.

Note: This implementation contemplates multiple root certs in its schema, but the API has not yet been extended to include this functionality.


Nested Class Summary
static class PSEConfigAdv.Instantiator
          Instantiator for PlatformConfig
 
Method Summary
 Object clone()
          Make a safe clone of this PSEConfigAdv.
static String getAdvertisementType()
          
 String getAdvType()
          
 String getBaseAdvType()
          
 String getCert()
          Returns the Root Ceritficate for this peer encoded as a BASE64 String.
 X509Certificate getCertificate()
          Returns the Root Certificate for this peer.
 X509Certificate[] getCertificateChain()
          Returns the Root Certificate for this peer.
 Document getDocument(MimeMediaType encodeAs)
          
 EncryptedPrivateKeyInfo getEncryptedPrivateKey()
          Get the encrypted private key from this advertisement.
 String getEncryptedPrivateKeyAlgo()
          Get the encrypted private key algorithm from this advertisement.
 String getEncryptedPrivKey()
          Get the encrypted private key from this advertisement.
 ID getID()
          
 String[] getIndexFields()
          
 URI getKeyStoreLocation()
           
 String getKeyStoreProvider()
           
 String getKeyStoreType()
           
 PrivateKey getPrivateKey(char[] password)
          Get the private key from this advertisement.
protected  boolean handleElement(Element raw)
          
 void setCert(String newCert)
          Returns the Root Ceritficate for this peer encoded as a BASE64 String.
 void setCertificate(X509Certificate newCert)
          Sets the Root Certificate for this peer.
 void setCertificateChain(X509Certificate[] newCert)
          Sets the Root Certificate for this peer.
 void setEncryptedPrivateKey(EncryptedPrivateKeyInfo newPriv, String algorithm)
          Set the encrypted private key for this advertisement.
 void setEncryptedPrivateKey(String newPriv, String algorithm)
          Set the encrypted private key for this advertisement.
 void setKeyStoreLocation(URI location)
           
 void setKeyStoreProvider(String provider)
           
 void setKeyStoreType(String type)
           
 void setPrivateKey(PrivateKey newPriv, char[] password)
          Set the encrypted private key for this advertisement.
 
Methods inherited from class net.jxta.document.Advertisement
toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

clone

public Object clone()
Make a safe clone of this PSEConfigAdv.

Overrides:
clone in class Advertisement
Returns:
Object A copy of this PSEConfigAdv

getAdvertisementType

public static String getAdvertisementType()


getAdvType

public String getAdvType()

Overrides:
getAdvType in class Advertisement

getBaseAdvType

public final String getBaseAdvType()

Specified by:
getBaseAdvType in class ExtendableAdvertisement

getID

public ID getID()

Specified by:
getID in class Advertisement

getCertificate

public X509Certificate getCertificate()
Returns the Root Certificate for this peer.

Returns:
the root certificate for this peer.

getCertificateChain

public X509Certificate[] getCertificateChain()
Returns the Root Certificate for this peer.

Returns:
the root certificate for this peer.

getCert

public String getCert()
Returns the Root Ceritficate for this peer encoded as a BASE64 String.

Returns:
the Root Certificate for this peer as a BASE64 String.

setCert

public void setCert(String newCert)
Returns the Root Ceritficate for this peer encoded as a BASE64 String.


setCertificate

public void setCertificate(X509Certificate newCert)
Sets the Root Certificate for this peer. If null then the Private Key is also cleared.

Parameters:
newCert - The root certificate to be associated with this peer or null if clearing the advertisement.

setCertificateChain

public void setCertificateChain(X509Certificate[] newCert)
Sets the Root Certificate for this peer. If null then the Private Key is also cleared.

Parameters:
newCert - The root certificate to be associated with this peer or null if clearing the advertisement.

getPrivateKey

public PrivateKey getPrivateKey(char[] password)
Get the private key from this advertisement. The private key is retrieved from the advertisement using the provided password.

Parameters:
password - the password to use in attempting to decrypt the private key.
Returns:
the decrypted private key.

getEncryptedPrivateKey

public EncryptedPrivateKeyInfo getEncryptedPrivateKey()
Get the encrypted private key from this advertisement.

Returns:
the encrypted private key.

getEncryptedPrivateKeyAlgo

public String getEncryptedPrivateKeyAlgo()
Get the encrypted private key algorithm from this advertisement.

Returns:
the decrypted private key algorithm.

getEncryptedPrivKey

public String getEncryptedPrivKey()
Get the encrypted private key from this advertisement.

Returns:
the encoded encrypted private key, a BASE64 String of a DER encoded PKCS8 EncrpytePrivateKeyInfo.

getKeyStoreType

public String getKeyStoreType()

setKeyStoreType

public void setKeyStoreType(String type)

getKeyStoreProvider

public String getKeyStoreProvider()

setKeyStoreProvider

public void setKeyStoreProvider(String provider)

getKeyStoreLocation

public URI getKeyStoreLocation()

setKeyStoreLocation

public void setKeyStoreLocation(URI location)

setEncryptedPrivateKey

public void setEncryptedPrivateKey(String newPriv,
                                   String algorithm)
Set the encrypted private key for this advertisement. The private key is provided as a BASE64 String of a DER encoded PKCS8 EncrpytePrivateKeyInfo.

Parameters:
newPriv - a BASE64 String of a DER encoded PKCS8 EncrpytePrivateKeyInfo.
algorithm - The public key algorithm used by this private key. Currently only "RSA" is supported.

setEncryptedPrivateKey

public void setEncryptedPrivateKey(EncryptedPrivateKeyInfo newPriv,
                                   String algorithm)
Set the encrypted private key for this advertisement.

Parameters:
newPriv - The encrypted private key.
algorithm - The public key algorithm used by this private key. Currently only "RSA" is supported.

setPrivateKey

public void setPrivateKey(PrivateKey newPriv,
                          char[] password)
Set the encrypted private key for this advertisement.

Parameters:
password - The password to be used in encrypting the private key
newPriv - The private key to be stored in encrypted form.

handleElement

protected boolean handleElement(Element raw)

Overrides:
handleElement in class ExtendableAdvertisement

getDocument

public Document getDocument(MimeMediaType encodeAs)

Overrides:
getDocument in class ExtendableAdvertisement

getIndexFields

public String[] getIndexFields()

Specified by:
getIndexFields in class Advertisement

JXTA J2SE