本文整理汇总了VB.NET中System.Security.Cryptography.AsymmetricAlgorithm.FromXmlString方法的典型用法代码示例。如果您正苦于以下问题:VB.NET AsymmetricAlgorithm.FromXmlString方法的具体用法?VB.NET AsymmetricAlgorithm.FromXmlString怎么用?VB.NET AsymmetricAlgorithm.FromXmlString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Security.Cryptography.AsymmetricAlgorithm
的用法示例。
在下文中一共展示了AsymmetricAlgorithm.FromXmlString方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的VB.NET代码示例。
示例1: FromXmlString
' Expected XML schema:
' <ProviderName></ProviderName>
' <KeyContainerName></KeyContainerName>
' <KeyNumber></KeyNumber>
' <ProviderType></ProviderType>
Public Overrides Sub FromXmlString(ByVal xmlString As String)
If Not xmlString Is Nothing Then
Dim doc As New XmlDocument
doc.LoadXml(xmlString)
Dim firstNode As XmlNode = doc.FirstChild
Dim nodeList As XmlNodeList
' Assemble parameters from values in each XML element.
cspParameters = New CspParameters
' KeyContainerName is optional.
nodeList = doc.GetElementsByTagName("KeyContainerName")
Dim keyName As String = nodeList.Item(0).InnerText
If Not keyName Is Nothing Then
cspParameters.KeyContainerName = keyName
End If
' KeyNumber is optional.
nodeList = doc.GetElementsByTagName("KeyNumber")
Dim keyNumber As String = nodeList.Item(0).InnerText
If Not keyNumber Is Nothing Then
cspParameters.KeyNumber = Int32.Parse(keyNumber)
End If
' ProviderName is optional.
nodeList = doc.GetElementsByTagName("ProviderName")
Dim providerName As String = nodeList.Item(0).InnerText
If Not providerName Is Nothing Then
cspParameters.ProviderName = providerName
End If
' ProviderType is optional.
nodeList = doc.GetElementsByTagName("ProviderType")
Dim providerType As String = nodeList.Item(0).InnerText
If Not providerType Is Nothing Then
cspParameters.ProviderType = Int32.Parse(providerType)
End If
Else
Throw New ArgumentNullException("xmlString")
End If
End Sub