File tree Expand file tree Collapse file tree 3 files changed +8
-14
lines changed
sdk/keyvault/azure-keyvault-certificates
azure/keyvault/certificates Expand file tree Collapse file tree 3 files changed +8
-14
lines changed Original file line number Diff line number Diff line change 6
6
- Added support for service API version ` 7.5 `
7
7
8
8
### Breaking Changes
9
+ > These changes do not impact the API of stable versions such as 4.7.0. Only code written against a beta version such as 4.8.0b2 may be affected.
10
+ - Removed ` CertificateProperties.x509_thumbprint_string ` . To get the certificate's thumbprint in hex, use
11
+ ` CertificateProperties.x509_thumbprint.hex() ` or print the ` CertificateProperties ` instance.
9
12
10
13
### Bugs Fixed
11
14
Original file line number Diff line number Diff line change @@ -144,7 +144,7 @@ def __init__(self, **kwargs: Any) -> None:
144
144
self ._tags = kwargs .pop ("tags" , None )
145
145
146
146
def __repr__ (self ) -> str :
147
- return f"<CertificateProperties [{ self .id } ]>" [:1024 ]
147
+ return f"<CertificateProperties [{ self ._x509_thumbprint . hex (). upper () } ]>" [:1024 ]
148
148
149
149
@classmethod
150
150
def _from_certificate_item (
@@ -254,22 +254,13 @@ def vault_url(self) -> str:
254
254
def x509_thumbprint (self ) -> bytes :
255
255
"""The certificate's thumbprint, in bytes.
256
256
257
+ To get the thumbprint as a hexadecimal string, call ``.hex()`` on this property.
258
+
257
259
:return: The certificate's thumbprint, in bytes.
258
260
:rtype: bytes
259
261
"""
260
262
return self ._x509_thumbprint
261
263
262
- @property
263
- def x509_thumbprint_string (self ) -> str :
264
- """The certificate's thumbprint, as a hexadecimal string.
265
-
266
- The thumbprint is formatted without colon delimiters; e.g. 76E1819FADF06A55EF4B126A2EF743C2BAE8A151.
267
-
268
- :return: The certificate's thumbprint, as a hexadecimal string.
269
- :rtype: str
270
- """
271
- return self ._x509_thumbprint .hex ().upper ()
272
-
273
264
@property
274
265
def tags (self ) -> Optional [Dict [str , str ]]:
275
266
"""Application specific metadata in the form of key-value pairs.
Original file line number Diff line number Diff line change @@ -774,9 +774,9 @@ def test_case_insensitive_key_type():
774
774
775
775
776
776
def test_thumbprint_hex ():
777
- """Ensure the `CertificateProperties.x509_thumbprint_string` property correctly converts a thumbprint to hex."""
777
+ """Ensure `CertificateProperties.__repr__()` correctly displays the cert's thumbprint as hex."""
778
778
properties = CertificateProperties (
779
779
cert_id = "https://vaultname.vault.azure.net/certificates/certname/version" ,
780
780
x509_thumbprint = b"v\xe1 \x81 \x9f \xad \xf0 jU\xef K\x12 j.\xf7 C\xc2 \xba \xe8 \xa1 Q" ,
781
781
)
782
- assert properties . x509_thumbprint_string == "76E1819FADF06A55EF4B126A2EF743C2BAE8A151"
782
+ assert "76E1819FADF06A55EF4B126A2EF743C2BAE8A151" in str ( properties )
You can’t perform that action at this time.
0 commit comments