Example usage for java.security KeyStore.PrivateKeyEntry KeyStore.PrivateKeyEntry

List of usage examples for java.security KeyStore.PrivateKeyEntry KeyStore.PrivateKeyEntry

Introduction

In this page you can find the example usage for java.security KeyStore.PrivateKeyEntry KeyStore.PrivateKeyEntry.

Prototype

public PrivateKeyEntry(PrivateKey privateKey, Certificate[] chain) 

Source Link

Document

Constructs a PrivateKeyEntry with a PrivateKey and corresponding certificate chain.

Usage

From source file:com.thoughtworks.go.security.Registration.java

public KeyStore.PrivateKeyEntry asKeyStoreEntry() {
    return new KeyStore.PrivateKeyEntry(privateKey, chain);
}

From source file:net.link.util.test.pkix.PkiTestUtils.java

public static KeyStore.PrivateKeyEntry generateKeyEntry(String dn) throws NoSuchAlgorithmException,
        InvalidAlgorithmParameterException, IOException, CertificateException, OperatorCreationException {

    KeyPair keyPair = generateKeyPair();
    return new KeyStore.PrivateKeyEntry(keyPair.getPrivate(),
            new Certificate[] { generateSelfSignedCertificate(keyPair, dn) });
}