91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 45KB
    文件類型: .zip
    金幣: 2
    下載: 0 次
    發布日期: 2021-06-16
  • 語言: Java
  • 標簽: Java??RSA??密鑰??

資源簡介

Java 生成RSA密鑰進行數據加密解密 支持超長字符分區 ,同時支持本地讀取生成的密鑰文件和遠程服務器上存放的秘鑰文件

資源截圖

代碼片段和文件信息

/*
?*?Java?base64?-?A?pure?Java?library?for?reading?and?writing?base64
?*???????????????encoded?streams.
?*?
?*?Copyright?(C)?2007-2009?Carlo?Pelliccia?(www.sauronsoftware.it)
?*?
?*?This?program?is?free?software:?you?can?redistribute?it?and/or?modify
?*?it?under?the?terms?of?the?GNU?Lesser?General?Public?License?version
?*?2.1?as?published?by?the?Free?Software?Foundation.
?*
?*?This?program?is?distributed?in?the?hope?that?it?will?be?useful
?*?but?WITHOUT?ANY?WARRANTY;?without?even?the?implied?warranty?of
?*?MERCHANTABILITY?or?FITNESS?FOR?A?PARTICULAR?PURPOSE.??See?the
?*?GNU?General?Public?License?for?more?details.
?*
?*?You?should?have?received?a?copy?of?the?GNU?Lesser?General?Public
?*?License?version?2.1?along?with?this?program.
?*?If?not?see?.
?*/
package?com.soft.common.shared.security.utils;

import?java.io.ByteArrayInputStream;
import?java.io.ByteArrayOutputStream;
import?java.io.File;
import?java.io.FileInputStream;
import?java.io.FileOutputStream;
import?java.io.IOException;
import?java.io.InputStream;
import?java.io.OutputStream;
import?java.io.UnsupportedEncodingException;

/**
?*?


?*?base64?encoding?and?decoding?utility?methods?both?for?binary?and?textual
?*?informations.
?*?


?*?
?*?@author?Carlo?Pelliccia
?*?@since?1.1
?*?@version?1.3
?*/
public?class?base64?{

/**
?*?


?*?Encodes?a?string.
?*?


?*?


?*?Before?the?string?is?encoded?in?base64?it?is?converted?in?a?binary
?*?sequence?using?the?system?default?charset.
?*?


?*?
?*?@param?str
?*????????????The?source?string.
?*?@return?The?encoded?string.
?*?@throws?RuntimeException
?*?????????????If?an?unexpected?error?occurs.
?*/
public?static?String?encode(String?str)?throws?RuntimeException?{
byte[]?bytes?=?str.getBytes();
byte[]?encoded?=?encode(bytes);
try?{
return?new?String(encoded?“ASCII“);
}?catch?(UnsupportedEncodingException?e)?{
throw?new?RuntimeException(“ASCII?is?not?supported!“?e);
}
}

/**
?*?


?*?Encodes?a?string.
?*?


?*?


?*?Before?the?string?is?encoded?in?base64?it?is?converted?in?a?binary
?*?sequence?using?the?supplied?charset.
?*?


?*?
?*?@param?str
?*????????????The?source?string
?*?@param?charset
?*????????????The?charset?name.
?*?@return?The?encoded?string.
?*?@throws?RuntimeException
?*?????????????If?an?unexpected?error?occurs.
?*?@since?1.2
?*/
public?static?String?encode(String?str?String?charset)
throws?RuntimeException?{
byte[]?bytes;
try?{
bytes?=?str.getBytes(charset);
}?catch?(UnsupportedEncodingException?e)?{
throw?new?RuntimeException(“Unsupported?charset:?“?+?charset?e);
}
byte[]?encoded?=?encode(bytes);
try?{
return?new?String(encoded?“ASCII“);
}?catch?(UnsupportedEncodingException?e)?{
throw?new?RuntimeException(“ASCII?is?not?supported!“?e);
}
}

/**
?*?


?*?Decodes?the?supplied?string.
?*?


?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2017-08-25?16:07??TestJavaRSA\
?????文件?????????301??2017-08-17?10:11??TestJavaRSA\.classpath
?????文件?????????387??2017-08-17?10:11??TestJavaRSA\.project
?????目錄???????????0??2017-08-25?16:07??TestJavaRSA\.settings\
?????文件?????????629??2017-08-17?10:11??TestJavaRSA\.settings\org.eclipse.jdt.core.prefs
?????目錄???????????0??2017-08-25?16:07??TestJavaRSA\bin\
?????目錄???????????0??2017-08-25?16:07??TestJavaRSA\bin\com\
?????目錄???????????0??2017-08-25?16:07??TestJavaRSA\bin\com\deppon\
?????目錄???????????0??2017-08-25?16:07??TestJavaRSA\bin\com\deppon\dpap\
?????目錄???????????0??2017-08-25?16:07??TestJavaRSA\bin\com\deppon\dpap\common\
?????目錄???????????0??2017-08-25?16:07??TestJavaRSA\bin\com\deppon\dpap\common\shared\
?????目錄???????????0??2017-08-25?16:07??TestJavaRSA\bin\com\deppon\dpap\common\shared\security\
?????目錄???????????0??2017-08-25?16:07??TestJavaRSA\bin\com\deppon\dpap\common\shared\security\utils\
?????文件????????5690??2017-08-22?09:49??TestJavaRSA\bin\com\deppon\dpap\common\shared\security\utils\base64.class
?????文件????????1904??2017-08-22?09:49??TestJavaRSA\bin\com\deppon\dpap\common\shared\security\utils\base64InputStream.class
?????文件????????1802??2017-08-22?09:49??TestJavaRSA\bin\com\deppon\dpap\common\shared\security\utils\base64OutputStream.class
?????文件????????2660??2017-08-22?09:49??TestJavaRSA\bin\com\deppon\dpap\common\shared\security\utils\base64Utils.class
?????文件????????1421??2017-08-24?16:48??TestJavaRSA\bin\com\deppon\dpap\common\shared\security\utils\ReadFromFile.class
?????文件????????6813??2017-08-22?09:49??TestJavaRSA\bin\com\deppon\dpap\common\shared\security\utils\RSAUtils.class
?????文件?????????554??2017-08-22?09:49??TestJavaRSA\bin\com\deppon\dpap\common\shared\security\utils\Shared.class
?????目錄???????????0??2017-08-25?16:07??TestJavaRSA\bin\com\deppon\javaRsa\
?????目錄???????????0??2017-08-25?16:07??TestJavaRSA\bin\com\deppon\javaRsa\test\
?????文件????????3291??2017-08-25?15:13??TestJavaRSA\bin\com\deppon\javaRsa\test\TestRsa.class
?????目錄???????????0??2017-08-25?16:07??TestJavaRSA\bin\com\soft\
?????目錄???????????0??2017-08-25?16:07??TestJavaRSA\bin\com\soft\common\
?????目錄???????????0??2017-08-25?16:07??TestJavaRSA\bin\com\soft\common\shared\
?????目錄???????????0??2017-08-25?16:07??TestJavaRSA\bin\com\soft\common\shared\security\
?????目錄???????????0??2017-08-25?16:07??TestJavaRSA\bin\com\soft\common\shared\security\utils\
?????文件????????5655??2017-08-25?15:54??TestJavaRSA\bin\com\soft\common\shared\security\utils\base64.class
?????文件????????1883??2017-08-25?15:54??TestJavaRSA\bin\com\soft\common\shared\security\utils\base64InputStream.class
?????文件????????1781??2017-08-25?15:54??TestJavaRSA\bin\com\soft\common\shared\security\utils\base64OutputStream.class
............此處省略24個文件信息

評論

共有 條評論