|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.perforce.p4java.impl.mapbased.rpc.func.client.ClientTrust
public class ClientTrust
Handle the client trust and fingerprint for Perforce SSL connections.
Field Summary | |
---|---|
static String |
CLIENT_TRUST_ADD_EXCEPTION_NEW_CONNECTION
|
static String |
CLIENT_TRUST_ADD_EXCEPTION_NEW_KEY
|
static String |
CLIENT_TRUST_ADDED
|
static String |
CLIENT_TRUST_ALREADY_ESTABLISHED
|
static String |
CLIENT_TRUST_EXCEPTION_NEW_CONNECTION
|
static String |
CLIENT_TRUST_EXCEPTION_NEW_KEY
|
static String |
CLIENT_TRUST_INSTALL_EXCEPTION
|
static String |
CLIENT_TRUST_MESSAGES
|
static String |
CLIENT_TRUST_REMOVED
|
static String |
CLIENT_TRUST_UNINSTALL_EXCEPTION
|
static String |
CLIENT_TRUST_WARNING_NEW_CONNECTION
|
static String |
CLIENT_TRUST_WARNING_NEW_KEY
|
static String |
CLIENT_TRUST_WARNING_NOT_ESTABLISHED
|
static String |
DIGEST_TYPE
|
static String |
FINGERPRINT_REPLACEMENT_USER_NAME
|
static String |
FINGERPRINT_USER_NAME
|
static char[] |
HEX_CHARS
|
Constructor Summary | |
---|---|
ClientTrust(RpcServer rpcServer)
Instantiates a new client trust. |
Method Summary | |
---|---|
static String |
convert2Hex(byte[] data)
Convert a byte array to a hexadecimal string |
boolean |
fingerprintExists(String serverIpPort,
String fingerprintUser)
Check if the fingerprint exists for the specified server IP and port |
boolean |
fingerprintMatches(String serverIpPort,
String fingerprintUser,
String fingerprint)
Check if the fingerprint for the specified server IP and port matches the one in trust file. |
static String |
generateFingerprint(PublicKey publicKey)
Generate fingerprint from public key using MessageDigest. |
static String |
generateFingerprint(X509Certificate certificate)
Generate fingerprint from a certificate using MessageDigest. |
PerforceMessages |
getMessages()
Gets the messages. |
void |
installFingerprint(String serverIpPort,
String fingerprintUser,
String fingerprint)
Install the fingerprint for the specified server IP and port |
void |
removeFingerprint(String serverIpPort,
String fingerprintUser)
Removes the fingerprint for the specified server IP and port |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String DIGEST_TYPE
public static final char[] HEX_CHARS
public static final String FINGERPRINT_USER_NAME
public static final String FINGERPRINT_REPLACEMENT_USER_NAME
public static final String CLIENT_TRUST_MESSAGES
public static final String CLIENT_TRUST_WARNING_NOT_ESTABLISHED
public static final String CLIENT_TRUST_WARNING_NEW_CONNECTION
public static final String CLIENT_TRUST_WARNING_NEW_KEY
public static final String CLIENT_TRUST_EXCEPTION_NEW_CONNECTION
public static final String CLIENT_TRUST_EXCEPTION_NEW_KEY
public static final String CLIENT_TRUST_ADD_EXCEPTION_NEW_CONNECTION
public static final String CLIENT_TRUST_ADD_EXCEPTION_NEW_KEY
public static final String CLIENT_TRUST_ADDED
public static final String CLIENT_TRUST_REMOVED
public static final String CLIENT_TRUST_ALREADY_ESTABLISHED
public static final String CLIENT_TRUST_INSTALL_EXCEPTION
public static final String CLIENT_TRUST_UNINSTALL_EXCEPTION
Constructor Detail |
---|
public ClientTrust(RpcServer rpcServer)
rpcServer
- the rpc serverMethod Detail |
---|
public void installFingerprint(String serverIpPort, String fingerprintUser, String fingerprint) throws TrustException
serverIpPort
- the serverIpPortfingerprintUser
- the fingerprintUserfingerprint
- the fingerprint
TrustException
- the trust exceptionpublic void removeFingerprint(String serverIpPort, String fingerprintUser) throws TrustException
serverIpPort
- the serverIpPortfingerprintUser
- the fingerprintUser
TrustException
- the trust exceptionpublic boolean fingerprintExists(String serverIpPort, String fingerprintUser)
serverIpPort
- the serverIpPortfingerprintUser
- the fingerprintUser
public boolean fingerprintMatches(String serverIpPort, String fingerprintUser, String fingerprint)
serverIpPort
- the serverIpPortfingerprintUser
- the fingerprintUserfingerprint
- the fingerprint
public static String generateFingerprint(PublicKey publicKey) throws NoSuchAlgorithmException
publicKey
- the public key
NoSuchAlgorithmException
- the no such algorithm exceptionpublic static String generateFingerprint(X509Certificate certificate) throws NoSuchAlgorithmException, CertificateEncodingException
certificate
- the certificate
NoSuchAlgorithmException
- the no such algorithm exception
CertificateEncodingException
- the certificate encoding exceptionpublic static String convert2Hex(byte[] data)
data
- the data
public PerforceMessages getMessages()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |