This extension as :py:class:`~cg:cryptography.x509.ExtensionType`.
510432
def as_extension(self):
        """"""
        return x509.extensions.Extension(oid=self.oid, critical=self.critical, value=self.extension_type)
270926
def guess_mime_type(self, path):
		
		_, ext = posixpath.splitext(path)
		if ext in self.extensions_map:
			return self.extensions_map[ext]
		ext = ext.lower()
		return self.extensions_map[ext if ext in self.extensions_map else '']
594759
def extension(self, file_type: Optional[FileType] = None) -> str:
        
        key = self._validate_enum(item=file_type, enum=FileType)
        extensions = EXTENSIONS[key]
        return self.random.choice(extensions)
522135
def modifyExtensions(self,
                         extensionObjects=[]):
        

        if len(extensionObjects) > 0 and \
           isinstance(extensionObjects[0], Extension):
            self._extensions = extensionObjects
            res = self.edit(str(self))
            self._json = None
            self.__init()
            return res
583512
def get_filter(cls, mimetype):
        
        filters = ' '.join(
            ['*%s' % ext for ext in mimetypes.guess_all_extensions(mimetype)])
        return '%s (%s)' % (mimetype, filters)
156819
private static RubyModule getExtensionsModule(Ruby rubyRuntime) {
        RubyModule asciidoctorModule = rubyRuntime.getModule("Asciidoctor");
        return asciidoctorModule.defineOrGetModuleUnder("Extensions");
    }
968107
def asDict(self):
        
        dct = super(RtiRegItem, self).asDict()
        dct['extensions'] = self.extensions
        return dct
145719
def _config(self) -> ExtensionConfig:
        
        return dict(pattern=self.__pattern__, search_in_keys=True, search_in_values=False)
683287
def certclone(chain, copy_extensions=False):

    for i in range(len(chain)):
        chain[i] = chain[i].to_cryptography()

    newchain = []

    '''
    
    '''

    first = True

    for original in chain[::-1]:

        #print(cert)

        key = rsa.generate_private_key(
            public_exponent=65537,
            key_size=2048,
            backend=default_backend()
            )

        key_pem = key.private_bytes(
            encoding=serialization.Encoding.PEM,
            format=serialization.PrivateFormat.TraditionalOpenSSL,
            encryption_algorithm=serialization.NoEncryption()
        ).decode()

        if first:
            print(key_pem)
            first=False

        pubkey = key.public_key()

        # Todo: Code to mimic the private key type of original cert
        # maybe based on pubkey.__class__
        cert = x509.CertificateBuilder()
        cert = cert.subject_name(original.subject)
        cert = cert.issuer_name(original.issuer)
        #cert = cert.serial_number(original.serial_number)
        cert = cert.serial_number(x509.random_serial_number())
        cert = cert.not_valid_before(original.not_valid_before)
        cert = cert.not_valid_after(original.not_valid_after)
        cert = cert.public_key(pubkey)

        if copy_extensions:
            for ext in original.extensions:
                cert = cert.add_extension(ext.value, critical=ext.critical)

        cert = cert.sign(private_key=key, algorithm=original.signature_hash_algorithm, backend=default_backend())
        cert_pem = cert.public_bytes(serialization.Encoding.PEM).decode()
        print(cert_pem)

        newchain.insert(0, cert)
299013
def bind(self, extension: Extension) -> 'DictMentor':
        
        if not Extension.is_valid_extension(extension):
            raise ValueError("Cannot bind extension due to missing interface requirements")
        self._extensions.append(extension)

        return self
1188404
public static void registerExtension (String extension, Class<? extends StreamDecoder> clazz)
    {
        _extensions.put(extension, clazz);
    }
6744
def custom_object_extension_prefix_strict(instance):
    
    for key, obj in instance['objects'].items():
        if not ('extensions' in obj and 'type' in obj and
                obj['type'] in enums.OBSERVABLE_EXTENSIONS):
            continue
        for ext_key in obj['extensions']:
            if (ext_key not in enums.OBSERVABLE_EXTENSIONS[obj['type']] and
                    not CUSTOM_TYPE_PREFIX_RE.match(ext_key)):
                yield JSONError("Custom Cyber Observable Object extension type"
                                " '%s' should start with 'x-' followed by a source "
                                "unique identifier (like a domain name with dots "
                                "replaced by hyphens), a hyphen and then the name."
                                % ext_key, instance['id'],
                                'custom-prefix')
261382
private static List<Integer> exploreExtensions(ByteBuffer input, List<Integer> ciphers)
            throws SSLException {
        int length = getInt16(input);           // length of extensions
        while (length > 0) {
            int extType = getInt16(input);      // extenson type
            int extLen = getInt16(input);       // length of extension data
            if (extType == 16) {      // 0x00: ty
                return ciphers;
            } else {                    // ignore other extensions
                processByteVector(input, extLen);
            }

            length -= extLen + 4;
        }
        return null;
    }
478035
def click(self):
        
        if self._click_extension is None:
            from .click_ext import ClickExtension
            self._click_extension = ClickExtension(
                config=self
            )
        return self._click_extension
1267973
def extended_key_usage(self):
        """"""
        try:
            ext = self.x509.extensions.get_extension_for_oid(ExtensionOID.EXTENDED_KEY_USAGE)
        except x509.ExtensionNotFound:
            return None
        return ExtendedKeyUsage(ext)
381817
def get_extension_classes():
    
    res = [SyntaxHighlightingExtension, SearchExtension, TagExtension,
           DevhelpExtension, LicenseExtension, GitUploadExtension,
           EditOnGitHubExtension]

    if sys.version_info[1] >= 5:
        res += [DBusExtension]

    try:
        from hotdoc.extensions.c.c_extension import CExtension
        res += [CExtension]
    except ImportError:
        pass

    try:
        from hotdoc.extensions.gi.gi_extension import GIExtension
        res += [GIExtension]
    except ImportError:
        pass

    return res
478681
def _register_extensions(self, namespace):
        """"""

        # Register any extension classes for this class.
        extmanager = ExtensionManager(
            'extensions.classes.{}'.format(namespace),
            propagate_map_exceptions=True
        )

        if extmanager.extensions:
            extmanager.map(util.register_extension_class, base=self)

        # Register any extension methods for this class.
        extmanager = ExtensionManager(
            'extensions.methods.{}'.format(namespace),
            propagate_map_exceptions=True
        )
        if extmanager.extensions:
            extmanager.map(util.register_extension_method, base=self)