'Saves the public key in PKCS#1 DER or PEM format.
:param format: the format to save; \'PEM\' or \'DER\'
:returns: the DER- or PEM-encoded public key.'

def save_pkcs1(self, format='PEM'):

    methods = {'PEM': self._save_pkcs1_pem, 'DER': self._save_pkcs1_der}
    if (format not in methods):
        formats = ',    '.join(sorted(methods.keys()))
        raise ValueError(('Unsupported    format:    %r,    try    one    of    %s' % (format, formats)))
    method = methods[format]
    return method()
