Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
Y
yzg-util
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
YZG
yzg-util
Commits
26394ccf
Commit
26394ccf
authored
Nov 18, 2020
by
yanzg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改实体位置
parent
6f5ed441
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
3 deletions
+4
-3
pom.xml
yzg-util-base/pom.xml
+1
-0
RsaHelper.java
.../src/main/java/com/yanzuoguang/util/helper/RsaHelper.java
+3
-3
No files found.
yzg-util-base/pom.xml
View file @
26394ccf
...
...
@@ -25,6 +25,7 @@
<groupId>
io.springfox
</groupId>
<artifactId>
springfox-swagger2
</artifactId>
</dependency>
</dependencies>
</project>
\ No newline at end of file
yzg-util-base/src/main/java/com/yanzuoguang/util/helper/RsaHelper.java
View file @
26394ccf
...
...
@@ -4,6 +4,7 @@ import com.yanzuoguang.util.contants.SystemContants;
import
com.yanzuoguang.util.exception.CodeException
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.util.Base64Utils
;
import
javax.crypto.Cipher
;
import
java.security.*
;
...
...
@@ -11,7 +12,6 @@ import java.security.interfaces.RSAPrivateKey;
import
java.security.interfaces.RSAPublicKey
;
import
java.security.spec.PKCS8EncodedKeySpec
;
import
java.security.spec.X509EncodedKeySpec
;
import
java.util.Base64
;
/**
* RSA
...
...
@@ -186,7 +186,7 @@ public final class RsaHelper {
* @throws Exception
*/
private
static
String
encodeBase64
(
byte
[]
source
)
throws
Exception
{
byte
[]
to
=
Base64
.
getEncoder
()
.
encode
(
source
);
byte
[]
to
=
Base64
Utils
.
encode
(
source
);
return
new
String
(
to
,
SystemContants
.
UTF8
);
}
...
...
@@ -199,6 +199,6 @@ public final class RsaHelper {
*/
private
static
byte
[]
decodeBase64
(
String
target
)
throws
Exception
{
byte
[]
from
=
target
.
getBytes
(
SystemContants
.
UTF8
);
return
Base64
.
getDecoder
()
.
decode
(
from
);
return
Base64
Utils
.
decode
(
from
);
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment