|
JXTA | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.jxta.document.Advertisement
net.jxta.document.ExtendableAdvertisement
net.jxta.impl.protocol.PSEConfigAdv
public final class PSEConfigAdv
Contains parameters for configuration of the PSE Membership Service.
The configuration advertisement can include an optional seed certificate chain and encrypted private key. If this seed information is present the PSE Membership Service will require an initial authentication to unlock the encrypted private key before creating the PSE keystore. The newly created PSE keystore will be "seeded" with the certificate chain and the private key. This mechanism allows for out-of-band distribution of JXTA identity information and avoids the need for remote authentication. 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 PSEConfigAdv |
Method Summary | |
---|---|
PSEConfigAdv |
clone()
|
static String |
getAdvertisementType()
Returns the identifying type of this Advertisement. |
String |
getAdvType()
Returns the identifying type of this Advertisement. |
String |
getBaseAdvType()
Returns the base type of this advertisement hierarchy. |
String |
getCert()
Returns the seed certificate encoded as a BASE64 String. |
X509Certificate |
getCertificate()
Returns the seed certificate. |
X509Certificate[] |
getCertificateChain()
Returns the seed certificate chain. |
Document |
getDocument(MimeMediaType encodeAs)
Write this advertisement into a document of the requested type. |
EncryptedPrivateKeyInfo |
getEncryptedPrivateKey()
Get the encrypted seed private key from this advertisement. |
String |
getEncryptedPrivateKeyAlgo()
Get the encrypted seed private key algorithm from this advertisement. |
String |
getEncryptedPrivKey()
Get the encrypted seed private key from this advertisement. |
ID |
getID()
Returns an ID which identifies this Advertisement as uniquely as
possible. |
String[] |
getIndexFields()
Returns the element names on which this advertisement should be indexed. |
URI |
getKeyStoreLocation()
Return the location of the Keystore or null if the PSE
Membership Service should use the default location. |
String |
getKeyStoreProvider()
Return the JCE provider which the PSE Membership Service should use for Keystores. |
String |
getKeyStoreType()
Return the JCE Keystore type which the PSE Membership Service should use. |
PrivateKey |
getPrivateKey(char[] password)
Get the seed private key from this advertisement. |
protected boolean |
handleElement(Element raw)
Process an individual element from the document during parse. |
void |
setCert(String newCert)
Sets the seed certificate for this peer from a BASE64 String. |
void |
setCertificate(X509Certificate newCert)
Sets the seed certificate for this peer. |
void |
setCertificateChain(X509Certificate[] newCerts)
Sets the seed Certificate chain for this peer. |
void |
setEncryptedPrivateKey(EncryptedPrivateKeyInfo newPriv,
String algorithm)
Set the encrypted seed private key for this advertisement. |
void |
setEncryptedPrivateKey(String newPriv,
String algorithm)
Set the encrypted private key for this advertisement. |
void |
setKeyStoreLocation(URI location)
Set the location of the Keystore or null if the PSE
Membership Service should use the default location. |
void |
setKeyStoreProvider(String provider)
Set the JCE provider which the PSE Membership Service should use for Keystores. |
void |
setKeyStoreType(String type)
Set the JCE Keystore type which the PSE Membership Service should use. |
void |
setPrivateKey(PrivateKey newPriv,
char[] password)
Set the encrypted seed private key for this advertisement. |
Methods inherited from class net.jxta.document.ExtendableAdvertisement |
---|
handleAttribute |
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 |
---|
public static String getAdvertisementType()
Advertisement adv = module.getSomeAdv();
String advType = adv.getAdvertisementType();
This is wrong and does not work the way you might expect.
This call is not polymorphic and calls
Advertisement.getAdvertisementType()
no matter what the real
type of the advertisement.
public PSEConfigAdv clone()
clone
in class Advertisement
public String getAdvType()
Advertisement.getAdvertisementType()
this method will return the correct
runtime type of an Advertisement object.
This implementation is provided for existing advertisements which do not
provide their own implementation. In most cases you should provide your
own implementation for efficiency reasons.
getAdvType
in class Advertisement
public final String getBaseAdvType()
final
.
getBaseAdvType
in class ExtendableAdvertisement
public ID getID()
Advertisement
as uniquely as
possible. This ID is typically used as the primary key for indexing of
the Advertisement within databases.
Each advertisement sub-class must choose an appropriate implementation
which returns canonical and relatively unique ID values for it's
instances. Since this ID is commonly used for indexing, the IDs returned
must be as unique as possible to avoid collisions. The value for the ID
returned can either be:
IllegalStateException
should be
thrown.
getID
in class Advertisement
ID.nullID
if this advertisement is of a type that is not
normally indexed.public X509Certificate getCertificate()
null
if there is no seed
certificate defined.public X509Certificate[] getCertificateChain()
null
if
there is no seed certificate chain defined.public String getCert()
public void setCert(String newCert)
newCert
- The seed certificate for this peer as a BASE64 String.public void setCertificate(X509Certificate newCert)
null
then the
Private Key is also cleared.
newCert
- The seed certificate for this PSE instance or null
to clear the seed certificates and private key.public void setCertificateChain(X509Certificate[] newCerts)
null
then the
Private Key is also cleared.
newCerts
- The seed certificate chain or null
to clear the seed certificates and private key.public PrivateKey getPrivateKey(char[] password)
password
- the password to use in attempting to decrypt the private
key.
public EncryptedPrivateKeyInfo getEncryptedPrivateKey()
public String getEncryptedPrivateKeyAlgo()
public String getEncryptedPrivKey()
public String getKeyStoreType()
null
if
the default Keystore type should be used. The PSE Membership Service
will create the keystore via
KeyStore.getInstance(keystore_type)
.
null
if the default keystore type should be used.public void setKeyStoreType(String type)
null
if the default Keystore type should be used. The PSE
Membership Service will create the keystore via
KeyStore.getInstance(keystore_type)
.
type
- The JCE Keystore type which the PSE Membership Service
should use. This value should be the name of valid JCE Keystore or
null
if the default Keystore type should be used.public String getKeyStoreProvider()
null
if the default provider should be used. The PSE
Membership Service will create the keystore via
KeyStore.getInstance(keystore_type, provider)
.
null
if the default provider should be used.public void setKeyStoreProvider(String provider)
null
if the default provider should be used. The PSE
Membership Service will create the keystore via
KeyStore.getInstance(keystore_type, provider)
.
provider
- The JCE provider which the PSE Membership Service
should use for Keystores. This value should be the name of valid JCE
provider or null
if the default provider should be used.public URI getKeyStoreLocation()
null
if the PSE
Membership Service should use the default location. The actual default
location may vary depending upon they Keystore type and provider and not
all location values may be valid for all Keystore types and providers.
null
if the PSE
Membership Service should use the default location.public void setKeyStoreLocation(URI location)
null
if the PSE
Membership Service should use the default location. The actual default
location may vary depending upon they Keystore type and provider and not
all location values may be valid for all Keystore types and providers.
location
- The location of the Keystore or null
if the PSE
Membership Service should use the default location.public void setEncryptedPrivateKey(String newPriv, String algorithm)
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.public void setEncryptedPrivateKey(EncryptedPrivateKeyInfo newPriv, String algorithm)
newPriv
- The encrypted seed private key.algorithm
- The public key algorithm used by this private key.
Currently only "RSA" is supported.public void setPrivateKey(PrivateKey newPriv, char[] password)
password
- The password to be used in encrypting the private keynewPriv
- The private key to be stored in encrypted form.protected boolean handleElement(Element raw)
protected boolean handleElement(Element elem) {
if (super.handleElement()) {
// it's been handled.
return true;
}
... handle elements here ...
// we don't know how to handle the element
return false;
}
handleElement
in class ExtendableAdvertisement
raw
- The element to be processed.
true
if the element was recognized, otherwise false.public Document getDocument(MimeMediaType encodeAs)
"text/plain"
encodes
the document in a "pretty-print" format for human viewing and
"text/xml" which provides an XML format.
We don't have any content to add, just build the document instance and
return it to implementations that actually do something with it.
- Overrides:
getDocument
in class ExtendableAdvertisement
- Parameters:
encodeAs
- MimeMediaType format representation requested.
- Returns:
- The
Advertisement
represented as a Document
of
the requested MIME Media Type.
public String[] getIndexFields()
getIndexFields
in class Advertisement
|
JXSE | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |