本文整理汇总了C#中org.xdrDecodeDynamicOpaque方法的典型用法代码示例。如果您正苦于以下问题:C# org.xdrDecodeDynamicOpaque方法的具体用法?C# org.xdrDecodeDynamicOpaque怎么用?C# org.xdrDecodeDynamicOpaque使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org
的用法示例。
在下文中一共展示了org.xdrDecodeDynamicOpaque方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: xdrDecodeCredVerf
/// <summary>
/// Decodes -- that is: deserializes -- an ONC/RPC authentication object
/// (credential & verifier) on the server side.
/// </summary>
/// <remarks>
/// Decodes -- that is: deserializes -- an ONC/RPC authentication object
/// (credential & verifier) on the server side.
/// </remarks>
/// <exception cref="org.acplt.oncrpc.OncRpcException">if an ONC/RPC error occurs.</exception>
/// <exception cref="System.IO.IOException">if an I/O error occurs.</exception>
public override sealed void xdrDecodeCredVerf(org.acplt.oncrpc.XdrDecodingStream
xdr)
{
//
// Reset the authentication object's state properly...
//
shorthandCred = null;
shorthandVerf = null;
//
// Pull off the shorthand credential information (opaque date) of
// the XDR stream...
//
shorthandCred = xdr.xdrDecodeDynamicOpaque();
if (shorthandCred.Length > org.acplt.oncrpc.OncRpcAuthConstants.ONCRPC_MAX_AUTH_BYTES)
{
throw (new org.acplt.oncrpc.OncRpcAuthenticationException(org.acplt.oncrpc.OncRpcAuthStatus
.ONCRPC_AUTH_BADCRED));
}
//
// We also need to decode the verifier. This must be of type
// AUTH_NONE too. For some obscure historical reasons, we have to
// deal with credentials and verifiers, although they belong together,
// according to Sun's specification.
//
if ((xdr.xdrDecodeInt() != org.acplt.oncrpc.OncRpcAuthType.ONCRPC_AUTH_NONE) || (
xdr.xdrDecodeInt() != 0))
{
throw (new org.acplt.oncrpc.OncRpcAuthenticationException(org.acplt.oncrpc.OncRpcAuthStatus
.ONCRPC_AUTH_BADVERF));
}
}
示例2: xdrDecode
/// <summary>
/// Decodes -- that is: deserializes -- a XDR opaque from a XDR stream in
/// compliance to RFC 1832.
/// </summary>
/// <remarks>
/// Decodes -- that is: deserializes -- a XDR opaque from a XDR stream in
/// compliance to RFC 1832.
/// </remarks>
/// <exception cref="OncRpcException">if an ONC/RPC error occurs.</exception>
/// <exception cref="System.IO.IOException">if an I/O error occurs.</exception>
/// <exception cref="org.acplt.oncrpc.OncRpcException"></exception>
public virtual void xdrDecode(org.acplt.oncrpc.XdrDecodingStream xdr)
{
value = xdr.xdrDecodeDynamicOpaque();
}
示例3: xdrDecodeVerf
/// <summary>
/// Decodes ONC/RPC authentication information in form of a verifier
/// when receiving an ONC/RPC reply message.
/// </summary>
/// <remarks>
/// Decodes ONC/RPC authentication information in form of a verifier
/// when receiving an ONC/RPC reply message.
/// </remarks>
/// <param name="xdr">
/// XDR stream from which to receive the verifier sent together
/// with an ONC/RPC reply message.
/// </param>
/// <exception cref="OncRpcAuthenticationException">
/// if the received verifier is
/// not kosher.
/// </exception>
/// <exception cref="OncRpcException">if an ONC/RPC error occurs.</exception>
/// <exception cref="System.IO.IOException">if an I/O error occurs.</exception>
/// <exception cref="org.acplt.oncrpc.OncRpcException"></exception>
internal override void xdrDecodeVerf(org.acplt.oncrpc.XdrDecodingStream xdr)
{
switch (xdr.xdrDecodeInt())
{
case org.acplt.oncrpc.OncRpcAuthType.ONCRPC_AUTH_NONE:
{
//
// The verifier sent in response to AUTH_UNIX or AUTH_SHORT credentials
// can only be AUTH_NONE or AUTH_SHORT. In the latter case we drop
// any old shorthand credential and use the new one.
//
//
// Make sure that the verifier does not contain any opaque data.
// Anything different from this is not kosher and an authentication
// exception will be thrown.
//
if (xdr.xdrDecodeInt() != 0)
{
throw (new org.acplt.oncrpc.OncRpcAuthenticationException(org.acplt.oncrpc.OncRpcAuthStatus
.ONCRPC_AUTH_FAILED));
}
break;
}
case org.acplt.oncrpc.OncRpcAuthType.ONCRPC_AUTH_SHORT:
{
//
// Fetch the credential from the XDR stream and make sure that
// it does conform to the length restriction as set forth in
// the ONC/RPC protocol.
//
shorthandCred = xdr.xdrDecodeDynamicOpaque();
if (shorthandCred.Length > org.acplt.oncrpc.OncRpcAuthConstants.ONCRPC_MAX_AUTH_BYTES)
{
throw (new org.acplt.oncrpc.OncRpcAuthenticationException(org.acplt.oncrpc.OncRpcAuthStatus
.ONCRPC_AUTH_FAILED));
}
break;
}
default:
{
//
// Do not accept any other kind of verifier sent.
//
throw (new org.acplt.oncrpc.OncRpcAuthenticationException(org.acplt.oncrpc.OncRpcAuthStatus
.ONCRPC_AUTH_INVALIDRESP));
}
}
}