bbclib.libs.bbclib_signature module
Copyright (c) 2018 beyond-blockchain.org.
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
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.
-
class
bbclib.libs.bbclib_signature.
BBcSignature
(key_type=2, unpack=None)[source]
Bases: object
Signature part in a transaction
-
add
(signature=None, pubkey=None)[source]
Add signature and public key
-
pack
()[source]
Pack this object
-
unpack
(data)[source]
Unpack into this object
Parameters: | data (bytes) – packed binary data |
Returns: | True if successful |
Return type: | bool |
-
verify
(digest, pubkey=None)[source]
Verify digest using pubkey in signature
Parameters: |
- digest (bytes) – digest to verify
- pubkey (bytes) – external public key for verification
|
Returns: | 0:invalid, 1:valid
|
Return type: | int
|