Beispiel #1
0
        /// <summary>
        /// To create Additional Authenticated Data and return byte[]
        /// </summary>
        /// <returns></returns>
        public byte[] ToAdditionalAuthenticatedData()
        {
            string data = String.Format("{0}.{1}.{2}",
                                        Header.GetBase64UrlFromNormalString(),
                                        EncryptedMasterKey.ToBase64UrlString(),
                                        InitializationVector.ToBase64UrlString()
                                        );

            return(Encoding.UTF8.GetBytes(data));
        }
Beispiel #2
0
 /// <summary>
 /// Convert this payload to Base64Url string
 /// </summary>
 /// <returns></returns>
 public string SerializeToBase64UrlString()
 {
     return(String.Format("{0}.{1}.{2}.{3}.{4}",
                          Header.GetBase64UrlFromNormalString(),
                          EncryptedMasterKey.ToBase64UrlString(),
                          InitializationVector.ToBase64UrlString(),
                          CipherText.ToBase64UrlString(),
                          Tag.ToBase64UrlString()
                          ));
 }