public class ClientTrust extends Object
Modifier and Type | Field and Description |
---|---|
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 and Description |
---|
ClientTrust(RpcServer rpcServer)
Instantiates a new client trust.
|
Modifier and Type | Method and Description |
---|---|
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
|
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
public ClientTrust(RpcServer rpcServer)
rpcServer
- the rpc serverpublic void installFingerprint(String serverIpPort, String fingerprintUser, String fingerprint) throws TrustException
serverIpPort
- the serverIpPortfingerprintUser
- the fingerprintUserfingerprint
- the fingerprintTrustException
- the trust exceptionpublic void removeFingerprint(String serverIpPort, String fingerprintUser) throws TrustException
serverIpPort
- the serverIpPortfingerprintUser
- the fingerprintUserTrustException
- the trust exceptionpublic boolean fingerprintExists(String serverIpPort, String fingerprintUser)
serverIpPort
- the serverIpPortfingerprintUser
- the fingerprintUserpublic boolean fingerprintMatches(String serverIpPort, String fingerprintUser, String fingerprint)
serverIpPort
- the serverIpPortfingerprintUser
- the fingerprintUserfingerprint
- the fingerprintpublic static String generateFingerprint(PublicKey publicKey) throws NoSuchAlgorithmException
publicKey
- the public keyNoSuchAlgorithmException
- the no such algorithm exceptionpublic static String generateFingerprint(X509Certificate certificate) throws NoSuchAlgorithmException, CertificateEncodingException
certificate
- the certificateNoSuchAlgorithmException
- the no such algorithm exceptionCertificateEncodingException
- the certificate encoding exceptionpublic static String convert2Hex(byte[] data)
data
- the datapublic PerforceMessages getMessages()
Copyright © 2017 Perforce Software. All Rights Reserved.