Code example for KeyStore

Methods: setKeyEntry

0
    } 
    public static void setSecretKey(KeyStore ks, String alias) throws Exception {
        setSecretKey(ks, alias, getSecretKey());
    } 
    public static void setSecretKey(KeyStore ks, String alias, SecretKey key) throws Exception {
        ks.setKeyEntry(alias,
                       key,
                       PASSWORD_KEY,
                       null); 
    } 
 
    public static void setSecretKeyBytes(KeyStore ks) throws Exception {
        setSecretKeyBytes(ks, ALIAS_SECRET);
    } 
    public static void setSecretKeyBytes(KeyStore ks, String alias) throws Exception {
        setSecretKeyBytes(ks, alias, getSecretKey());
    } 
    public static void setSecretKeyBytes(KeyStore ks, String alias, SecretKey key)
            throws Exception { 
        ks.setKeyEntry(alias,
                       key.getEncoded(),