p2ps.peer
Interface SecurityManager

All Known Implementing Classes:
SecurityManagerImp

public interface SecurityManager

The security context associated with a peer instance.

Version:
$Revision: 295 $
Author:
Ian Wang

Field Summary
static java.lang.String AUTHORIZATION_SECURITY
          Verify only group authorization of secure connections (default server level)
static java.lang.String IDENTITY_AND_AUTHORIZATION_SECURITY
          Verity the identity and group authorization of secure connections (default client level)
static java.lang.String PEER_SECURITY_CONTEXT_PROPERTY
           
static java.lang.String REMOTE_SECURITY_CONTEXT_PROPERTY
           
static java.lang.String SECURITY_MANAGER_PROPERTY
           
static java.lang.String TRUST_SECURITY
          Verity the trust of secure connections
 
Method Summary
 java.security.KeyStore getKeyStore()
           
 java.io.File getKeyStoreFile()
           
 char[] getKeyStorePassword()
           
 java.lang.String getPeerCertificateAlias()
           
 char[] getPeerCertificatePassword()
           
 java.lang.String getPeerDistinguishedName()
           
 SecurityContext getSecurityContext(Peer peer, java.lang.String clientsecurity, java.lang.String serversecurity)
           
 SecurityContext getSecurityContext(java.lang.String peercert, java.lang.String[] groupcert)
           
 SecurityContext getSecurityContext(java.net.URI uri, Peer peer)
           
 TrustManager getTrustManager(java.lang.String securitylevel)
           
 void reloadKeyStore()
          Reloads the keystore
 void setTrustManager(java.lang.String securitylevel, TrustManager trustmanager)
          Sets the trust manager responsible for accepting certificates for the specified context
 

Field Detail

IDENTITY_AND_AUTHORIZATION_SECURITY

public static final java.lang.String IDENTITY_AND_AUTHORIZATION_SECURITY
Verity the identity and group authorization of secure connections (default client level)

See Also:
Constant Field Values

TRUST_SECURITY

public static final java.lang.String TRUST_SECURITY
Verity the trust of secure connections

See Also:
Constant Field Values

AUTHORIZATION_SECURITY

public static final java.lang.String AUTHORIZATION_SECURITY
Verify only group authorization of secure connections (default server level)

See Also:
Constant Field Values

SECURITY_MANAGER_PROPERTY

public static final java.lang.String SECURITY_MANAGER_PROPERTY
See Also:
Constant Field Values

PEER_SECURITY_CONTEXT_PROPERTY

public static final java.lang.String PEER_SECURITY_CONTEXT_PROPERTY
See Also:
Constant Field Values

REMOTE_SECURITY_CONTEXT_PROPERTY

public static final java.lang.String REMOTE_SECURITY_CONTEXT_PROPERTY
See Also:
Constant Field Values
Method Detail

getKeyStore

public java.security.KeyStore getKeyStore()
Returns:
the key store for this context

getKeyStoreFile

public java.io.File getKeyStoreFile()
Returns:
the key store file

getKeyStorePassword

public char[] getKeyStorePassword()
Returns:
the key store password

reloadKeyStore

public void reloadKeyStore()
                    throws java.security.KeyStoreException
Reloads the keystore

Throws:
java.security.KeyStoreException

getPeerCertificateAlias

public java.lang.String getPeerCertificateAlias()
Returns:
the alias of the main peer certificate

getPeerCertificatePassword

public char[] getPeerCertificatePassword()
Returns:
the password for the peer certificate

getPeerDistinguishedName

public java.lang.String getPeerDistinguishedName()
                                          throws java.security.KeyStoreException
Returns:
the distingushed name for the peer (or null if unknown)
Throws:
java.security.KeyStoreException

getSecurityContext

public SecurityContext getSecurityContext(Peer peer,
                                          java.lang.String clientsecurity,
                                          java.lang.String serversecurity)
Parameters:
clientsecurity - the client security level
serversecurity - the server security level
Returns:
the security context for the specified peer

getSecurityContext

public SecurityContext getSecurityContext(java.net.URI uri,
                                          Peer peer)
Returns:
the security context for the specified uri, or null if unknown/ not applicable

getSecurityContext

public SecurityContext getSecurityContext(java.lang.String peercert,
                                          java.lang.String[] groupcert)
Returns:
the security context for the specified peer and group certificate thumbprints

getTrustManager

public TrustManager getTrustManager(java.lang.String securitylevel)
Parameters:
securitylevel - the security level (e.g. IDENTITY_SECURITY or TRUST_SECURITY)
Returns:
the trust manager responsible for accepting certificates for the specified security level.

setTrustManager

public void setTrustManager(java.lang.String securitylevel,
                            TrustManager trustmanager)
Sets the trust manager responsible for accepting certificates for the specified context