/// <summary>
        /// Decodes the base64 encoded string |data|. The returned value will be NULL if
        /// the decoding fails.
        /// </summary>
        public static CefBinaryValue Base64Decode(string data)
        {
            fixed(char *data_str = data)
            {
                var n_data = new cef_string_t(data_str, data != null ? data.Length : 0);

                return(CefBinaryValue.FromNative(libcef.base64decode(&n_data)));
            }
        }
Exemple #2
0
        /// <summary>
        /// Returns the PEM encoded data for the certificate issuer chain.
        /// If we failed to encode a certificate in the chain it is still
        /// present in the array but is an empty string.
        /// </summary>
        public void GetPEMEncodedIssuerChain(out long chainCount, out CefBinaryValue chain)
        {
            UIntPtr             n_chainCount;
            cef_binary_value_t *n_chain;

            cef_sslinfo_t.get_pemencoded_issuer_chain(_self, &n_chainCount, &n_chain);

            chainCount = (long)n_chainCount;
            chain      = CefBinaryValue.FromNative(n_chain);
        }
        /// <summary>
        /// Returns the value at the specified key as type binary. The returned
        /// value will reference existing data.
        /// </summary>
        public CefBinaryValue GetBinary(string key)
        {
            fixed(char *key_str = key)
            {
                var n_key    = new cef_string_t(key_str, key != null ? key.Length : 0);
                var n_result = cef_dictionary_value_t.get_binary(_self, &n_key);

                return(CefBinaryValue.FromNative(n_result));
            }
        }
        /// <summary>
        /// Creates a new object that is not owned by any other object. The specified
        /// |data| will be copied.
        /// </summary>
        public static CefBinaryValue Create(byte[] data)
        {
            if (data == null)
            {
                throw new ArgumentNullException("data");

                fixed(byte *data_ptr = data)
                {
                    var value = cef_binary_value_t.create(data_ptr, (UIntPtr)data.LongLength);

                    return(CefBinaryValue.FromNative(value));
                }
        }
        /// <summary>
        /// Returns a copy of this object. The data in this object will also be copied.
        /// </summary>
        public CefBinaryValue Copy()
        {
            var value = cef_binary_value_t.copy(_self);

            return(CefBinaryValue.FromNative(value));
        }
 /// <summary>
 /// Returns the underlying value as type binary. The returned reference may
 /// become invalid if the value is owned by another object or if ownership is
 /// transferred to another object in the future. To maintain a reference to
 /// the value after assigning ownership to a dictionary or list pass this
 /// object to the SetValue() method instead of passing the returned reference
 /// to SetBinary().
 /// </summary>
 public CefBinaryValue GetBinary()
 {
     return(CefBinaryValue.FromNative(
                cef_value_t.get_binary(_self)
                ));
 }