Package com.encryption

Examples of com.encryption.RSAEncrypter.loadKey()


       * 利用公钥加密DES密钥
       */
      // 从文件中加载公钥
      RSAEncrypter encrypt = new RSAEncrypter();
      String publicKeyPath = "D:/hdfs/" + userId + "/publicKey";
      RSAPublicKey publicKey = (RSAPublicKey) encrypt.loadKey(
          publicKeyPath, 1);
      encryptedDataSecretKey = encrypt.encrypt(publicKey,
          key.getEncoded());
    } catch (Exception e) {
      e.printStackTrace();
View Full Code Here


    /*
     * 加载私钥
     */
    String privateKeyPath = privateKey.getAbsolutePath();

    RSAPrivateKey pKey = (RSAPrivateKey) encrypter.loadKey(privateKeyPath,
        0);
    /*
     * 获取fileId对应的已加密数据密钥
     */
    HdfsFile dfsfile = filedao.findFile(fileId);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.