Skip to content

Commit 7ce3dac

Browse files
committed
OIDs: Add dotted_form properties
This introduces a new property, dotted_form, for querying the dotted form of the OID. Signed-off-by: Alexander Scheel <[email protected]>
1 parent 1254810 commit 7ce3dac

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

gssapi/raw/oids.pyx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,9 +156,12 @@ cdef class OID:
156156
pos += 1
157157
return decoded
158158

159+
@property
160+
def dotted_form(self):
161+
return '.'.join(str(x) for x in self._decode_asn1ber())
162+
159163
def __repr__(self):
160-
dotted_oid = '.'.join(str(x) for x in self._decode_asn1ber())
161-
return "<OID {0}>".format(dotted_oid)
164+
return "<OID {0}>".format(self.dotted_form)
162165

163166
def __hash__(self):
164167
return hash(self.__bytes__())

0 commit comments

Comments
 (0)