Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set-OnlineResponderRevocationConfiguration Cannot find an overload for "Oid2" #148

Closed
bencoremans opened this issue May 19, 2021 · 3 comments
Labels
docs This is documentation issue. Doesn't require changes in code. fixed-vNext The item is fixed in development code. Will be available in next release.

Comments

@bencoremans
Copy link

Why is this cmdlet failing with "Cannot find an overload for "Oid2" and the argument count: "1"."?

Connect-OnlineResponder $ArrayController | Get-OnlineResponderRevocationConfiguration -Name "$($OcspSigningCA.displayname)" | Set-OnlineResponderRevocationConfiguration -SigningCertTemplate "$SigningCertificateTemplate"
-SigningServer $OcspSigningCA -SigningFlag "Silent, SigningCertAutoRenewal, ForceDelegatedCert, AutoDiscoverSigninCert, ResponderIdKeyHash, SigningCertAutoEnrollment"
-BaseCrlUrl "http://cdp-nac.tenant19.nl/pki/tenant19-eca.crl" -DeltaCrlUrl "http://cdp-nac.tenant19.nl/pki/tenant19-eca+.crl"
-HashAlgorithm (New-Object System.Security.Cryptography.Oid2 "sha256")

ErrorRecord : Cannot find an overload for "Oid2" and the argument count: "1".
WasThrownFromThrowStatement : False
Message : Cannot find an overload for "Oid2" and the argument count: "1".
Data : {System.Management.Automation.Interpreter.InterpretedFrameInfo}
InnerException : System.Management.Automation.MethodException: Cannot find an overload for "Oid2" and the
argument count: "1".
at System.Management.Automation.Adapter.GetBestMethodAndArguments(String methodName, M
ethodInformation[] methods, PSMethodInvocationConstraints invocationConstraints, Object[]
arguments, Object[]& newArguments)
at System.Management.Automation.DotNetAdapter.ConstructorInvokeDotNet(Type type, Const
ructorInfo[] constructors, Object[] arguments)
at Microsoft.PowerShell.Commands.NewObjectCommand.CallConstructor(Type type, Construct
orInfo[] constructors, Object[] args)
TargetSite : System.Collections.ObjectModel.Collection`1[System.Management.Automation.PSObject] Invoke
(System.Collections.IEnumerable)
StackTrace : at System.Management.Automation.Runspaces.PipelineBase.Invoke(IEnumerable input)
at Microsoft.PowerShell.Executor.ExecuteCommandHelper(Pipeline tempPipeline, Exception
& exceptionThrown, ExecutionOptions options)
HelpLink :
Source : System.Management.Automation
HResult : -2146233087

@ToHo14
Copy link

ToHo14 commented Jun 11, 2021

I think that's an error in the example. Use:

New-Object System.Security.Cryptography.Oid2 "sha256", $true

The $true add the end is for directory lookup. If set to $false only local registry is queried.

@Crypt32
Copy link
Collaborator

Crypt32 commented Jun 11, 2021

Yes, it is doc bug. In your case, last parameter should be $false. $true is necessary only when lookup for:

  • certificate templates
  • custom application policies (or EKU)
  • custom issuance/certificate policies

in all other cases it should be $false to speedup the lookup process, because other OID groups cannot be registered in AD.

@Crypt32 Crypt32 added the docs This is documentation issue. Doesn't require changes in code. label Jun 11, 2021
@Crypt32 Crypt32 added the fixed-vNext The item is fixed in development code. Will be available in next release. label Jun 8, 2023
@Crypt32
Copy link
Collaborator

Crypt32 commented Jun 15, 2023

Fixed in v4.0.0

@Crypt32 Crypt32 closed this as completed Jun 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs This is documentation issue. Doesn't require changes in code. fixed-vNext The item is fixed in development code. Will be available in next release.
Projects
None yet
Development

No branches or pull requests

3 participants