我们从Python开源项目中,提取了以下18个代码示例,用于说明如何使用oauth2client.client.AssertionCredentials()。
def sign_blob(self, blob): """Cryptographically sign a blob (of bytes). Implements abstract method :meth:`oauth2client.client.AssertionCredentials.sign_blob`. Args: blob: bytes, Message to be signed. Returns: tuple, A pair of the private key ID used to sign the blob and the signed contents. """ return app_identity.sign_blob(blob)
def sign_blob(self, blob): """Cryptographically sign a blob (of bytes). Implements abstract method :meth:`oauth2client.client.AssertionCredentials.sign_blob`. Args: blob: bytes, Message to be signed. Returns: tuple, A pair of the private key ID used to sign the blob and the signed contents. """ return self._private_key_id, self._signer.sign(blob)
def test__generate_assertion_abstract(self): credentials = client.AssertionCredentials(None) with self.assertRaises(NotImplementedError): credentials._generate_assertion()
def test_sign_blob_abstract(self): credentials = client.AssertionCredentials(None) with self.assertRaises(NotImplementedError): credentials.sign_blob(b'blob')