Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
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
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
d399e079
Unverified
Commit
d399e079
authored
Nov 13, 2018
by
k8s-ci-robot
Committed by
GitHub
Nov 13, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #71002 from awly/certutil-cleanup
Remove unused funcs in certutil
parents
48d788de
162b3642
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
28 deletions
+0
-28
cert.go
staging/src/k8s.io/client-go/util/cert/cert.go
+0
-28
No files found.
staging/src/k8s.io/client-go/util/cert/cert.go
View file @
d399e079
...
@@ -260,34 +260,6 @@ func GenerateSelfSignedCertKeyWithFixtures(host string, alternateIPs []net.IP, a
...
@@ -260,34 +260,6 @@ func GenerateSelfSignedCertKeyWithFixtures(host string, alternateIPs []net.IP, a
return
certBuffer
.
Bytes
(),
keyBuffer
.
Bytes
(),
nil
return
certBuffer
.
Bytes
(),
keyBuffer
.
Bytes
(),
nil
}
}
// FormatBytesCert receives byte array certificate and formats in human-readable format
func
FormatBytesCert
(
cert
[]
byte
)
(
string
,
error
)
{
block
,
_
:=
pem
.
Decode
(
cert
)
c
,
err
:=
x509
.
ParseCertificate
(
block
.
Bytes
)
if
err
!=
nil
{
return
""
,
fmt
.
Errorf
(
"failed to parse certificate [%v]"
,
err
)
}
return
FormatCert
(
c
),
nil
}
// FormatCert receives certificate and formats in human-readable format
func
FormatCert
(
c
*
x509
.
Certificate
)
string
{
var
ips
[]
string
for
_
,
ip
:=
range
c
.
IPAddresses
{
ips
=
append
(
ips
,
ip
.
String
())
}
altNames
:=
append
(
ips
,
c
.
DNSNames
...
)
res
:=
fmt
.
Sprintf
(
"Issuer: CN=%s | Subject: CN=%s | CA: %t
\n
"
,
c
.
Issuer
.
CommonName
,
c
.
Subject
.
CommonName
,
c
.
IsCA
,
)
res
+=
fmt
.
Sprintf
(
"Not before: %s Not After: %s"
,
c
.
NotBefore
,
c
.
NotAfter
)
if
len
(
altNames
)
>
0
{
res
+=
fmt
.
Sprintf
(
"
\n
Alternate Names: %v"
,
altNames
)
}
return
res
}
func
ipsToStrings
(
ips
[]
net
.
IP
)
[]
string
{
func
ipsToStrings
(
ips
[]
net
.
IP
)
[]
string
{
ss
:=
make
([]
string
,
0
,
len
(
ips
))
ss
:=
make
([]
string
,
0
,
len
(
ips
))
for
_
,
ip
:=
range
ips
{
for
_
,
ip
:=
range
ips
{
...
...
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