예제 #1
0
        internal byte[][] EncodeIpAddress(IPAddress address)
        {
            byte[] addressBytes = address.GetAddressBytes();

            byte[][] ipAddressTlv = DerEncoder.SegmentedEncodeOctetString(addressBytes);
            ipAddressTlv[0][0] = (byte)GeneralNameTag.IpAddress;

            return(ipAddressTlv);
        }
예제 #2
0
        internal static byte[][] SegmentedEncodedX509Extension(this X509Extension extension)
        {
            if (extension.Critical)
            {
                return(DerEncoder.ConstructSegmentedSequence(
                           DerEncoder.SegmentedEncodeOid(extension.Oid),
                           DerEncoder.SegmentedEncodeBoolean(extension.Critical),
                           DerEncoder.SegmentedEncodeOctetString(extension.RawData)));
            }

            return(DerEncoder.ConstructSegmentedSequence(
                       DerEncoder.SegmentedEncodeOid(extension.Oid),
                       DerEncoder.SegmentedEncodeOctetString(extension.RawData)));
        }