Documentation
¶
Overview ¶
Copyright 2024 The KubeEdge Authors.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2024 The KubeEdge Authors.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2024 The KubeEdge Authors.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2024 The KubeEdge Authors.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2024 The KubeEdge Authors.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2024 The KubeEdge Authors.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- Constants
- func ReadPEMFile(file string) (*pem.Block, error)
- func WriteDERToPEMFile(file, t string, der []byte) (*pem.Block, error)
- type CAHandler
- type CAHandlerType
- type Handler
- type HanndlerType
- type PrivateKeyWrap
- type SignCertsOptions
- func SignCertsOptionsWithCA(cfg certutil.Config, caDER, caKeyDER []byte, publicKey any, ...) SignCertsOptions
- func SignCertsOptionsWithCSR(csrDER, caDER, caKeyDER []byte, usages []x509.ExtKeyUsage, ...) SignCertsOptions
- func SignCertsOptionsWithK8sCSR(csrDER []byte, usages []x509.ExtKeyUsage, expiration time.Duration) SignCertsOptions
Constants ¶
const ( CAHandlerTypeX509 = "x509" HandlerTypeX509 = "x509" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CAHandler ¶
type CAHandler interface {
// GenPrivateKey create a private key
GenPrivateKey() (PrivateKeyWrap, error)
// New creates CA certificate, returns a pem block.
NewSelfSigned(key PrivateKeyWrap) (*pem.Block, error)
}
func GetCAHandler ¶
func GetCAHandler(t CAHandlerType) CAHandler
type CAHandlerType ¶
type CAHandlerType string
type Handler ¶
type Handler interface {
// GenPrivateKey create a private key
GenPrivateKey() (PrivateKeyWrap, error)
// CreateCSR create a certificate request, returns a pem block.
CreateCSR(sub pkix.Name, pkw PrivateKeyWrap, alt *certutil.AltNames) (*pem.Block, error)
// SignCerts creates a certificate, returns a pem block.
SignCerts(opts SignCertsOptions) (*pem.Block, error)
}
func GetHandler ¶
func GetHandler(t HanndlerType) Handler
type HanndlerType ¶
type HanndlerType string
type PrivateKeyWrap ¶
type SignCertsOptions ¶
type SignCertsOptions struct {
// contains filtered or unexported fields
}
func SignCertsOptionsWithCA ¶
func SignCertsOptionsWithCSR ¶
func SignCertsOptionsWithCSR(csrDER, caDER, caKeyDER []byte, usages []x509.ExtKeyUsage, expiration time.Duration) SignCertsOptions
func SignCertsOptionsWithK8sCSR ¶
func SignCertsOptionsWithK8sCSR(csrDER []byte, usages []x509.ExtKeyUsage, expiration time.Duration) SignCertsOptions