Java Key Create getKeyString(Key key)

Here you can find the source of getKeyString(Key key)

Description

get Key String

License

Open Source License

Declaration

public static String getKeyString(Key key) throws Exception 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import sun.misc.BASE64Encoder;

import java.security.*;

public class Main {

    public static String getKeyString(Key key) throws Exception {
        byte[] keyBytes = key.getEncoded();
        return (new BASE64Encoder()).encode(keyBytes);
    }/*from  w  w  w .java 2  s .c o m*/
}

Related

  1. getKeyStore(String path, String passwd, String storeType)
  2. getKeyStoreFromFile(String filePath, char[] password)
  3. getKeyStoreFromFile(String keystoreName, String password, String home)
  4. getKeyStores()
  5. getKeyString(Key key)