X7ROOT File Manager
Current Path:
/opt/golang/1.17.2/src/crypto/x509
opt
/
golang
/
1.17.2
/
src
/
crypto
/
x509
/
📁
..
📄
cert_pool.go
(7.09 KB)
📄
example_test.go
(5.32 KB)
📁
internal
📄
name_constraints_test.go
(44.53 KB)
📄
parser.go
(30.43 KB)
📄
pem_decrypt.go
(7.23 KB)
📄
pem_decrypt_test.go
(8.92 KB)
📄
pkcs1.go
(4.65 KB)
📄
pkcs8.go
(4.36 KB)
📄
pkcs8_test.go
(8.05 KB)
📁
pkix
📄
root.go
(793 B)
📄
root_aix.go
(463 B)
📄
root_bsd.go
(844 B)
📄
root_darwin.go
(9.11 KB)
📄
root_darwin_test.go
(1017 B)
📄
root_ios.go
(281.3 KB)
📄
root_ios_gen.go
(4.31 KB)
📄
root_js.go
(450 B)
📄
root_linux.go
(1012 B)
📄
root_omit.go
(1 KB)
📄
root_omit_test.go
(669 B)
📄
root_plan9.go
(844 B)
📄
root_solaris.go
(591 B)
📄
root_unix.go
(2.73 KB)
📄
root_unix_test.go
(6.13 KB)
📄
root_windows.go
(10.18 KB)
📄
sec1.go
(4.14 KB)
📄
sec1_test.go
(5.36 KB)
📄
test-file.crt
(1.9 KB)
📁
testdata
📄
verify.go
(33.09 KB)
📄
verify_test.go
(89.1 KB)
📄
x509.go
(69.55 KB)
📄
x509_test.go
(129.06 KB)
📄
x509_test_import.go
(1.72 KB)
Editing: x509_test_import.go
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build ignore // +build ignore // This file is run by the x509 tests to ensure that a program with minimal // imports can sign certificates without errors resulting from missing hash // functions. package main import ( "crypto/rand" "crypto/x509" "crypto/x509/pkix" "encoding/pem" "math/big" "strings" "time" ) func main() { block, _ := pem.Decode([]byte(pemPrivateKey)) rsaPriv, err := x509.ParsePKCS1PrivateKey(block.Bytes) if err != nil { panic("Failed to parse private key: " + err.Error()) } template := x509.Certificate{ SerialNumber: big.NewInt(1), Subject: pkix.Name{ CommonName: "test", Organization: []string{"Σ Acme Co"}, }, NotBefore: time.Unix(1000, 0), NotAfter: time.Unix(100000, 0), KeyUsage: x509.KeyUsageCertSign, } if _, err = x509.CreateCertificate(rand.Reader, &template, &template, &rsaPriv.PublicKey, rsaPriv); err != nil { panic("failed to create certificate with basic imports: " + err.Error()) } } var pemPrivateKey = testingKey(`-----BEGIN RSA TESTING KEY----- MIIBOgIBAAJBALKZD0nEffqM1ACuak0bijtqE2QrI/KLADv7l3kK3ppMyCuLKoF0 fd7Ai2KW5ToIwzFofvJcS/STa6HA5gQenRUCAwEAAQJBAIq9amn00aS0h/CrjXqu /ThglAXJmZhOMPVn4eiu7/ROixi9sex436MaVeMqSNf7Ex9a8fRNfWss7Sqd9eWu RTUCIQDasvGASLqmjeffBNLTXV2A5g4t+kLVCpsEIZAycV5GswIhANEPLmax0ME/ EO+ZJ79TJKN5yiGBRsv5yvx5UiHxajEXAiAhAol5N4EUyq6I9w1rYdhPMGpLfk7A IU2snfRJ6Nq2CQIgFrPsWRCkV+gOYcajD17rEqmuLrdIRexpg8N1DOSXoJ8CIGlS tAboUGBxTDq3ZroNism3DaMIbKPyYrAqhKov1h5V -----END RSA TESTING KEY----- `) func testingKey(s string) string { return strings.ReplaceAll(s, "TESTING KEY", "PRIVATE KEY") }
Upload File
Create Folder