Java 类org.bouncycastle.asn1.dvcs.DVCSRequestInformation 实例源码

项目:irma_future_id    文件:DVCSParseTest.java   
private void validate(String name, DVCSRequestInformation info, DVCSRequestInformation expected)
{
    validate(name + ".version", new Integer(info.getVersion()), new Integer(expected.getVersion()));
    validate(name + ".service", info.getService().getValue(), expected.getService().getValue());
    validate(name + ".nonce", info.getNonce(), expected.getNonce());
    validate(name + ".requestTime", info.getRequestTime(), expected.getRequestTime());
    validate(name + ".requester", info.getRequester(), expected.getRequester());
    validate(name + ".requestPolicy", info.getRequestPolicy(), expected.getRequestPolicy());
    validate(name + ".dvcs", info.getDVCS(), expected.getDVCS());
    validate(name + ".dataLocations", info.getDataLocations(), expected.getDataLocations());
    validate(name + ".extensions", info.getExtensions(), expected.getExtensions());
}
项目:bc-java    文件:DVCSParseTest.java   
private void validate(String name, DVCSRequestInformation info, DVCSRequestInformation expected)
{
    validate(name + ".version", new Integer(info.getVersion()), new Integer(expected.getVersion()));
    validate(name + ".service", info.getService().getValue(), expected.getService().getValue());
    validate(name + ".nonce", info.getNonce(), expected.getNonce());
    validate(name + ".requestTime", info.getRequestTime(), expected.getRequestTime());
    validate(name + ".requester", info.getRequester(), expected.getRequester());
    validate(name + ".requestPolicy", info.getRequestPolicy(), expected.getRequestPolicy());
    validate(name + ".dvcs", info.getDVCS(), expected.getDVCS());
    validate(name + ".dataLocations", info.getDataLocations(), expected.getDataLocations());
    validate(name + ".extensions", info.getExtensions(), expected.getExtensions());
}
项目:ipack    文件:DVCSRequestInfo.java   
/**
 * Compares two DVCRequestInfo structures: one from DVCRequest, and one from DVCResponse.
 * This function implements RFC 3029, 9.1 checks of reqInfo.
 *
 * @param requestInfo  - DVCRequestInfo of DVCRequest
 * @param responseInfo - DVCRequestInfo of DVCResponse
 * @return true if server's requestInfo matches client's requestInfo
 */
public static boolean validate(DVCSRequestInfo requestInfo, DVCSRequestInfo responseInfo)
{
    // RFC 3029, 9.1
    // The DVCS MAY modify the fields:
    // 'dvcs', 'requester', 'dataLocations', and 'nonce' of the ReqInfo structure.

    DVCSRequestInformation clientInfo = requestInfo.data;
    DVCSRequestInformation serverInfo = responseInfo.data;

    if (clientInfo.getVersion() != serverInfo.getVersion())
    {
        return false;
    }
    if (!clientEqualsServer(clientInfo.getService(), serverInfo.getService()))
    {
        return false;
    }
    if (!clientEqualsServer(clientInfo.getRequestTime(), serverInfo.getRequestTime()))
    {
        return false;
    }
    if (!clientEqualsServer(clientInfo.getRequestPolicy(), serverInfo.getRequestPolicy()))
    {
        return false;
    }
    if (!clientEqualsServer(clientInfo.getExtensions(), serverInfo.getExtensions()))
    {
        return false;
    }

    // RFC 3029, 9.1. The only modification allowed to a 'nonce'
    // is the inclusion of a new field if it was not present,
    // or to concatenate other data to the end (right) of an existing value.

    if (clientInfo.getNonce() != null)
    {
        if (serverInfo.getNonce() == null)
        {
            return false;
        }
        byte[] clientNonce = clientInfo.getNonce().toByteArray();
        byte[] serverNonce = serverInfo.getNonce().toByteArray();
        if (serverNonce.length < clientNonce.length)
        {
            return false;
        }
        if (!Arrays.areEqual(clientNonce, Arrays.copyOfRange(serverNonce, 0, clientNonce.length)))
        {
            return false;
        }
    }

    return true;
}
项目:gwt-crypto    文件:DVCSRequestInfo.java   
/**
 * Compares two DVCRequestInfo structures: one from DVCRequest, and one from DVCResponse.
 * This function implements RFC 3029, 9.1 checks of reqInfo.
 *
 * @param requestInfo  - DVCRequestInfo of DVCRequest
 * @param responseInfo - DVCRequestInfo of DVCResponse
 * @return true if server's requestInfo matches client's requestInfo
 */
public static boolean validate(DVCSRequestInfo requestInfo, DVCSRequestInfo responseInfo)
{
    // RFC 3029, 9.1
    // The DVCS MAY modify the fields:
    // 'dvcs', 'requester', 'dataLocations', and 'nonce' of the ReqInfo structure.

    DVCSRequestInformation clientInfo = requestInfo.data;
    DVCSRequestInformation serverInfo = responseInfo.data;

    if (clientInfo.getVersion() != serverInfo.getVersion())
    {
        return false;
    }
    if (!clientEqualsServer(clientInfo.getService(), serverInfo.getService()))
    {
        return false;
    }
    if (!clientEqualsServer(clientInfo.getRequestTime(), serverInfo.getRequestTime()))
    {
        return false;
    }
    if (!clientEqualsServer(clientInfo.getRequestPolicy(), serverInfo.getRequestPolicy()))
    {
        return false;
    }
    if (!clientEqualsServer(clientInfo.getExtensions(), serverInfo.getExtensions()))
    {
        return false;
    }

    // RFC 3029, 9.1. The only modification allowed to a 'nonce'
    // is the inclusion of a new field if it was not present,
    // or to concatenate other data to the end (right) of an existing value.

    if (clientInfo.getNonce() != null)
    {
        if (serverInfo.getNonce() == null)
        {
            return false;
        }
        byte[] clientNonce = clientInfo.getNonce().toByteArray();
        byte[] serverNonce = serverInfo.getNonce().toByteArray();
        if (serverNonce.length < clientNonce.length)
        {
            return false;
        }
        if (!Arrays.areEqual(clientNonce, Arrays.copyOfRange(serverNonce, 0, clientNonce.length)))
        {
            return false;
        }
    }

    return true;
}
项目:Aki-SSL    文件:DVCSRequestInfo.java   
/**
 * Compares two DVCRequestInfo structures: one from DVCRequest, and one from DVCResponse.
 * This function implements RFC 3029, 9.1 checks of reqInfo.
 *
 * @param requestInfo  - DVCRequestInfo of DVCRequest
 * @param responseInfo - DVCRequestInfo of DVCResponse
 * @return true if server's requestInfo matches client's requestInfo
 */
public static boolean validate(DVCSRequestInfo requestInfo, DVCSRequestInfo responseInfo)
{
    // RFC 3029, 9.1
    // The DVCS MAY modify the fields:
    // 'dvcs', 'requester', 'dataLocations', and 'nonce' of the ReqInfo structure.

    DVCSRequestInformation clientInfo = requestInfo.data;
    DVCSRequestInformation serverInfo = responseInfo.data;

    if (clientInfo.getVersion() != serverInfo.getVersion())
    {
        return false;
    }
    if (!clientEqualsServer(clientInfo.getService(), serverInfo.getService()))
    {
        return false;
    }
    if (!clientEqualsServer(clientInfo.getRequestTime(), serverInfo.getRequestTime()))
    {
        return false;
    }
    if (!clientEqualsServer(clientInfo.getRequestPolicy(), serverInfo.getRequestPolicy()))
    {
        return false;
    }
    if (!clientEqualsServer(clientInfo.getExtensions(), serverInfo.getExtensions()))
    {
        return false;
    }

    // RFC 3029, 9.1. The only modification allowed to a 'nonce'
    // is the inclusion of a new field if it was not present,
    // or to concatenate other data to the end (right) of an existing value.

    if (clientInfo.getNonce() != null)
    {
        if (serverInfo.getNonce() == null)
        {
            return false;
        }
        byte[] clientNonce = clientInfo.getNonce().toByteArray();
        byte[] serverNonce = serverInfo.getNonce().toByteArray();
        if (serverNonce.length < clientNonce.length)
        {
            return false;
        }
        if (!Arrays.areEqual(clientNonce, Arrays.copyOfRange(serverNonce, 0, clientNonce.length)))
        {
            return false;
        }
    }

    return true;
}
项目:irma_future_id    文件:DVCSRequestInfo.java   
/**
 * Compares two DVCRequestInfo structures: one from DVCRequest, and one from DVCResponse.
 * This function implements RFC 3029, 9.1 checks of reqInfo.
 *
 * @param requestInfo  - DVCRequestInfo of DVCRequest
 * @param responseInfo - DVCRequestInfo of DVCResponse
 * @return true if server's requestInfo matches client's requestInfo
 */
public static boolean validate(DVCSRequestInfo requestInfo, DVCSRequestInfo responseInfo)
{
    // RFC 3029, 9.1
    // The DVCS MAY modify the fields:
    // 'dvcs', 'requester', 'dataLocations', and 'nonce' of the ReqInfo structure.

    DVCSRequestInformation clientInfo = requestInfo.data;
    DVCSRequestInformation serverInfo = responseInfo.data;

    if (clientInfo.getVersion() != serverInfo.getVersion())
    {
        return false;
    }
    if (!clientEqualsServer(clientInfo.getService(), serverInfo.getService()))
    {
        return false;
    }
    if (!clientEqualsServer(clientInfo.getRequestTime(), serverInfo.getRequestTime()))
    {
        return false;
    }
    if (!clientEqualsServer(clientInfo.getRequestPolicy(), serverInfo.getRequestPolicy()))
    {
        return false;
    }
    if (!clientEqualsServer(clientInfo.getExtensions(), serverInfo.getExtensions()))
    {
        return false;
    }

    // RFC 3029, 9.1. The only modification allowed to a 'nonce'
    // is the inclusion of a new field if it was not present,
    // or to concatenate other data to the end (right) of an existing value.

    if (clientInfo.getNonce() != null)
    {
        if (serverInfo.getNonce() == null)
        {
            return false;
        }
        byte[] clientNonce = clientInfo.getNonce().toByteArray();
        byte[] serverNonce = serverInfo.getNonce().toByteArray();
        if (serverNonce.length < clientNonce.length)
        {
            return false;
        }
        if (!Arrays.areEqual(clientNonce, Arrays.copyOfRange(serverNonce, 0, clientNonce.length)))
        {
            return false;
        }
    }

    return true;
}
项目:bc-java    文件:DVCSRequestInfo.java   
/**
 * Compares two DVCRequestInfo structures: one from DVCRequest, and one from DVCResponse.
 * This function implements RFC 3029, 9.1 checks of reqInfo.
 *
 * @param requestInfo  - DVCRequestInfo of DVCRequest
 * @param responseInfo - DVCRequestInfo of DVCResponse
 * @return true if server's requestInfo matches client's requestInfo
 */
public static boolean validate(DVCSRequestInfo requestInfo, DVCSRequestInfo responseInfo)
{
    // RFC 3029, 9.1
    // The DVCS MAY modify the fields:
    // 'dvcs', 'requester', 'dataLocations', and 'nonce' of the ReqInfo structure.

    DVCSRequestInformation clientInfo = requestInfo.data;
    DVCSRequestInformation serverInfo = responseInfo.data;

    if (clientInfo.getVersion() != serverInfo.getVersion())
    {
        return false;
    }
    if (!clientEqualsServer(clientInfo.getService(), serverInfo.getService()))
    {
        return false;
    }
    if (!clientEqualsServer(clientInfo.getRequestTime(), serverInfo.getRequestTime()))
    {
        return false;
    }
    if (!clientEqualsServer(clientInfo.getRequestPolicy(), serverInfo.getRequestPolicy()))
    {
        return false;
    }
    if (!clientEqualsServer(clientInfo.getExtensions(), serverInfo.getExtensions()))
    {
        return false;
    }

    // RFC 3029, 9.1. The only modification allowed to a 'nonce'
    // is the inclusion of a new field if it was not present,
    // or to concatenate other data to the end (right) of an existing value.

    if (clientInfo.getNonce() != null)
    {
        if (serverInfo.getNonce() == null)
        {
            return false;
        }
        byte[] clientNonce = clientInfo.getNonce().toByteArray();
        byte[] serverNonce = serverInfo.getNonce().toByteArray();
        if (serverNonce.length < clientNonce.length)
        {
            return false;
        }
        if (!Arrays.areEqual(clientNonce, Arrays.copyOfRange(serverNonce, 0, clientNonce.length)))
        {
            return false;
        }
    }

    return true;
}
项目:ipack    文件:DVCSRequestInfo.java   
/**
 * Constructs DVCRequestInfo from byte array (DER encoded DVCSRequestInformation).
 *
 * @param in
 */
public DVCSRequestInfo(byte[] in)
{
    this(DVCSRequestInformation.getInstance(in));
}
项目:ipack    文件:DVCSRequestInfo.java   
/**
 * Constructs DVCRequestInfo from DVCSRequestInformation ASN.1 structure.
 *
 * @param data
 */
public DVCSRequestInfo(DVCSRequestInformation data)
{
    this.data = data;
}
项目:ipack    文件:DVCSRequestInfo.java   
/**
 * Converts to corresponding ASN.1 structure (DVCSRequestInformation).
 *
 * @return
 */
public DVCSRequestInformation toASN1Structure()
{
    return data;
}
项目:gwt-crypto    文件:DVCSRequestInfo.java   
/**
 * Constructs DVCRequestInfo from byte array (DER encoded DVCSRequestInformation).
 *
 * @param in a byte array holding the encoding of a DVCSRequestInformation structure.
 */
public DVCSRequestInfo(byte[] in)
{
    this(DVCSRequestInformation.getInstance(in));
}
项目:gwt-crypto    文件:DVCSRequestInfo.java   
/**
 * Constructs DVCRequestInfo from DVCSRequestInformation ASN.1 structure.
 *
 * @param data a DVCSRequestInformation to populate this object with.
 */
public DVCSRequestInfo(DVCSRequestInformation data)
{
    this.data = data;
}
项目:gwt-crypto    文件:DVCSRequestInfo.java   
/**
 * Converts to corresponding ASN.1 structure (DVCSRequestInformation).
 *
 * @return a DVCSRequestInformation object.
 */
public DVCSRequestInformation toASN1Structure()
{
    return data;
}
项目:Aki-SSL    文件:DVCSRequestInfo.java   
/**
 * Constructs DVCRequestInfo from byte array (DER encoded DVCSRequestInformation).
 *
 * @param in a byte array holding the encoding of a DVCSRequestInformation structure.
 */
public DVCSRequestInfo(byte[] in)
{
    this(DVCSRequestInformation.getInstance(in));
}
项目:Aki-SSL    文件:DVCSRequestInfo.java   
/**
 * Constructs DVCRequestInfo from DVCSRequestInformation ASN.1 structure.
 *
 * @param data a DVCSRequestInformation to populate this object with.
 */
public DVCSRequestInfo(DVCSRequestInformation data)
{
    this.data = data;
}
项目:Aki-SSL    文件:DVCSRequestInfo.java   
/**
 * Converts to corresponding ASN.1 structure (DVCSRequestInformation).
 *
 * @return a DVCSRequestInformation object.
 */
public DVCSRequestInformation toASN1Structure()
{
    return data;
}
项目:irma_future_id    文件:DVCSRequestInfo.java   
/**
 * Constructs DVCRequestInfo from byte array (DER encoded DVCSRequestInformation).
 *
 * @param in
 */
public DVCSRequestInfo(byte[] in)
{
    this(DVCSRequestInformation.getInstance(in));
}
项目:irma_future_id    文件:DVCSRequestInfo.java   
/**
 * Constructs DVCRequestInfo from DVCSRequestInformation ASN.1 structure.
 *
 * @param data
 */
public DVCSRequestInfo(DVCSRequestInformation data)
{
    this.data = data;
}
项目:irma_future_id    文件:DVCSRequestInfo.java   
/**
 * Converts to corresponding ASN.1 structure (DVCSRequestInformation).
 *
 * @return
 */
public DVCSRequestInformation toASN1Structure()
{
    return data;
}
项目:bc-java    文件:DVCSRequestInfo.java   
/**
 * Constructs DVCRequestInfo from byte array (DER encoded DVCSRequestInformation).
 *
 * @param in
 */
public DVCSRequestInfo(byte[] in)
{
    this(DVCSRequestInformation.getInstance(in));
}
项目:bc-java    文件:DVCSRequestInfo.java   
/**
 * Constructs DVCRequestInfo from DVCSRequestInformation ASN.1 structure.
 *
 * @param data
 */
public DVCSRequestInfo(DVCSRequestInformation data)
{
    this.data = data;
}
项目:bc-java    文件:DVCSRequestInfo.java   
/**
 * Converts to corresponding ASN.1 structure (DVCSRequestInformation).
 *
 * @return
 */
public DVCSRequestInformation toASN1Structure()
{
    return data;
}