34 lines
1.5 KiB
VB.net
34 lines
1.5 KiB
VB.net
Public Class Helpers
|
|
|
|
''' <summary>
|
|
''' Encodes the EnvelopeUUID and the ReceiverSignature into an EnvelopeKey
|
|
''' </summary>
|
|
''' <param name="pEnvelopeUuid"></param>
|
|
''' <param name="pReceiverSignature"></param>
|
|
''' <returns>The EnvelopeKey</returns>
|
|
Public Shared Function EncodeEnvelopeReceiverId(pEnvelopeUuid As String, pReceiverSignature As String) As String
|
|
Dim oString = $"{pEnvelopeUuid}::{pReceiverSignature}"
|
|
'TODO: Verschlüsseln
|
|
Return oString
|
|
End Function
|
|
|
|
''' <summary>
|
|
''' Decodes the EnvelopeKey and returns the EnvelopeUUID and the ReceiverSignature
|
|
''' </summary>
|
|
''' <param name="pEnvelopeReceiverId">The EnvelopeKey</param>
|
|
''' <returns>A tuple containing EnvelopeUUID and Receiver Signature</returns>
|
|
Public Shared Function DecodeEnvelopeReceiverId(pEnvelopeReceiverId As String) As Tuple(Of String, String)
|
|
Dim oSplit = pEnvelopeReceiverId.Split(New String() {"::"}, StringSplitOptions.None)
|
|
'TODO: Entschlüsseln
|
|
Return New Tuple(Of String, String)(oSplit(0), oSplit(1))
|
|
End Function
|
|
|
|
Public Shared Function GetEnvelopeURL(pHost As String, pEnvelopeUuid As String, pReceiverSignature As String) As String
|
|
|
|
Dim oEnvelopeUserReference As String = EncodeEnvelopeReceiverId(pEnvelopeUuid, pReceiverSignature)
|
|
Dim oURL As String = String.Format("{0}/EnvelopeKey/{1}", pHost.Trim(), oEnvelopeUserReference)
|
|
Return oURL
|
|
|
|
End Function
|
|
End Class
|