Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
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
DEMO
spring-boot
Commits
ba8a32fa
Commit
ba8a32fa
authored
Jun 05, 2018
by
dreis2211
Committed by
Stephane Nicoll
Jun 06, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace commons-codec Base64 usage
See gh-13378
parent
e3bf5188
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
ReactiveTokenValidatorTests.java
...re/cloudfoundry/reactive/ReactiveTokenValidatorTests.java
+3
-3
TokenValidatorTests.java
...toconfigure/cloudfoundry/servlet/TokenValidatorTests.java
+3
-3
No files found.
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/reactive/ReactiveTokenValidatorTests.java
View file @
ba8a32fa
/*
* Copyright 2012-201
7
the original author or authors.
* Copyright 2012-201
8
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -29,7 +29,6 @@ import java.util.Collections;
import
java.util.Map
;
import
java.util.concurrent.ConcurrentHashMap
;
import
org.apache.commons.codec.binary.Base64
;
import
org.junit.Before
;
import
org.junit.Test
;
import
org.mockito.Mock
;
...
...
@@ -337,7 +336,8 @@ public class ReactiveTokenValidatorTests {
+
"J/OOn5zOs8yf26os0q3+JUM=\n-----END PRIVATE KEY-----"
;
String
privateKey
=
signingKey
.
replace
(
"-----BEGIN PRIVATE KEY-----\n"
,
""
);
privateKey
=
privateKey
.
replace
(
"-----END PRIVATE KEY-----"
,
""
);
byte
[]
pkcs8EncodedBytes
=
Base64
.
decodeBase64
(
privateKey
);
privateKey
=
privateKey
.
replace
(
"\n"
,
""
);
byte
[]
pkcs8EncodedBytes
=
Base64Utils
.
decodeFromString
(
privateKey
);
PKCS8EncodedKeySpec
keySpec
=
new
PKCS8EncodedKeySpec
(
pkcs8EncodedBytes
);
KeyFactory
keyFactory
=
KeyFactory
.
getInstance
(
"RSA"
);
return
keyFactory
.
generatePrivate
(
keySpec
);
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/servlet/TokenValidatorTests.java
View file @
ba8a32fa
/*
* Copyright 2012-201
7
the original author or authors.
* Copyright 2012-201
8
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -28,7 +28,6 @@ import java.security.spec.PKCS8EncodedKeySpec;
import
java.util.Collections
;
import
java.util.Map
;
import
org.apache.commons.codec.binary.Base64
;
import
org.junit.Before
;
import
org.junit.Rule
;
import
org.junit.Test
;
...
...
@@ -248,7 +247,8 @@ public class TokenValidatorTests {
+
"J/OOn5zOs8yf26os0q3+JUM=\n-----END PRIVATE KEY-----"
;
String
privateKey
=
signingKey
.
replace
(
"-----BEGIN PRIVATE KEY-----\n"
,
""
);
privateKey
=
privateKey
.
replace
(
"-----END PRIVATE KEY-----"
,
""
);
byte
[]
pkcs8EncodedBytes
=
Base64
.
decodeBase64
(
privateKey
);
privateKey
=
privateKey
.
replace
(
"\n"
,
""
);
byte
[]
pkcs8EncodedBytes
=
Base64Utils
.
decodeFromString
(
privateKey
);
PKCS8EncodedKeySpec
keySpec
=
new
PKCS8EncodedKeySpec
(
pkcs8EncodedBytes
);
KeyFactory
keyFactory
=
KeyFactory
.
getInstance
(
"RSA"
);
return
keyFactory
.
generatePrivate
(
keySpec
);
...
...
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