def to_der(self):
    ' Encodes this signature using DER\n\n        Returns:\n            bytes: The DER encoding of (self.r, self.s).\n        '
    (r, s) = self._canonicalize()
    total_length = ((6 + len(r)) + len(s))
    der = (((bytes([48, (total_length - 2), 2, len(r)]) + r) + bytes([2, len(s)])) + s)
    return der
Encodes this signature using DER

Returns:
    bytes: The DER encoding of (self.r, self.s).
def to_der(self):
    ' Encodes this signature using DER\n\n        Returns:\n            bytes: The DER encoding of (self.r, self.s).\n        '
    (r, s) = self._canonicalize()
    total_length = ((6 + len(r)) + len(s))
    der = (((bytes([48, (total_length - 2), 2, len(r)]) + r) + bytes([2, len(s)])) + s)
    return der