public void ReadFrom(XmlDictionaryReader reader, long maxBufferSize)
{
this.ValidateReadState();
reader.MoveToStartElement(this.OpeningElementName, NamespaceUri);
this.encoding = reader.GetAttribute(EncodingAttribute, null);
this.id = reader.GetAttribute(System.ServiceModel.XD.XmlEncryptionDictionary.Id, null) ?? System.ServiceModel.Security.SecurityUniqueId.Create().Value;
this.wsuId = reader.GetAttribute(System.ServiceModel.XD.XmlEncryptionDictionary.Id, System.ServiceModel.XD.UtilityDictionary.Namespace) ?? System.ServiceModel.Security.SecurityUniqueId.Create().Value;
this.mimeType = reader.GetAttribute(MimeTypeAttribute, null);
this.type = reader.GetAttribute(TypeAttribute, null);
this.ReadAdditionalAttributes(reader);
reader.Read();
if (reader.IsStartElement(EncryptionMethodElement.ElementName, NamespaceUri))
{
this.encryptionMethod.ReadFrom(reader);
}
if (this.tokenSerializer.CanReadKeyIdentifier(reader))
{
this.KeyIdentifier = this.tokenSerializer.ReadKeyIdentifier(reader);
}
reader.ReadStartElement(CipherDataElementName, NamespaceUri);
reader.ReadStartElement(CipherValueElementName, NamespaceUri);
if (maxBufferSize == 0L)
{
this.ReadCipherData(reader);
}
else
{
this.ReadCipherData(reader, maxBufferSize);
}
reader.ReadEndElement();
reader.ReadEndElement();
this.ReadAdditionalElements(reader);
reader.ReadEndElement();
this.State = EncryptionState.Read;
}