def _build_signature(self):
sig_contents =self.payload + "<STR_LIT:.>" +b64encode(b"<STR_LIT>").decode("<STR_LIT:ascii>") + "<STR_LIT:.>" +b64encode(b"<STR_LIT>").decode("<STR_LIT:ascii>") + "<STR_LIT:.>" +b64encode(b"<STR_LIT>").decode("<STR_LIT:ascii>")<EOL>sig_hash = SHA256.new(sig_contents.encode("<STR_LIT:ascii>"))<EOL>cipher = PKCS1_v1_5.new(self.private_key)<EOL>sig = urlsafe_b64encode(cipher.sign(sig_hash))<EOL>key_id = urlsafe_b64encode(bytes(self.author_handle, encoding="<STR_LIT:utf-8>"))<EOL>return sig, key_id<EOL>
Create the signature using the private key.