Documentation ¶
Overview ¶
Copyright © 2018 Zhao Ming <mint.zhao.chiu@gmail.com>.
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 © 2018 Zhao Ming <mint.zhao.chiu@gmail.com>.
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 © 2018 Zhao Ming <mint.zhao.chiu@gmail.com>.
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 © 2018 Zhao Ming <mint.zhao.chiu@gmail.com>.
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 ¶
This section is empty.
Variables ¶
var ( // ErrSignerAlreadyRegistered indicated a signer already registered in to signers ErrSignerAlreadyRegistered = errors.New("signer already registered") // ErrSignerNotFound indicated a signer can not found in signers ErrSignerNotFound = errors.New("signer not found") // ErrNilSignerOptions indicated a nil signer options ErrNilSignerOptions = errors.New("invalid options, it must not be nil") // ErrInvalidSignerOptions indicated invalid signer options ErrInvalidSignerOptions = errors.New("invalid options") )
Functions ¶
func DeRegisterSigner ¶
func DeRegisterSigner(signerName string)
DeRegisterSigner delete signer from signers, SHOULD ONLY USED IN TEST
func RegisterSigner ¶
RegisterSigner stores signer into signers, if signerName is already registered, return error
Types ¶
type Signer ¶
type Signer interface { // Sign signs msg using PrivateKey k. Sign(k crypto.PrivateKey, msg []byte, opts crypto.SignerOpts) ([]byte, error) // Verify verifies signature against key k and digest Verify(k crypto.PublicKey, signature, msg []byte, opts crypto.SignerOpts) (bool, error) }
Signer contains signing functions